mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 18:22:39 +03:00
Replace empty issuer with null.
This commit is contained in:
parent
d8988c2227
commit
33b727b238
@ -71,8 +71,14 @@ class OathCredential with _$OathCredential {
|
|||||||
int period,
|
int period,
|
||||||
bool touchRequired) = _OathCredential;
|
bool touchRequired) = _OathCredential;
|
||||||
|
|
||||||
factory OathCredential.fromJson(Map<String, dynamic> json) =>
|
factory OathCredential.fromJson(Map<String, dynamic> json) {
|
||||||
_$OathCredentialFromJson(json);
|
final value = _$OathCredentialFromJson(json);
|
||||||
|
// Replace empty issuer string with null
|
||||||
|
return switch (value.issuer) {
|
||||||
|
(String issuer) when issuer.isEmpty => value.copyWith(issuer: null),
|
||||||
|
_ => value,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
|
Loading…
Reference in New Issue
Block a user