mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-22 16:32:01 +03:00
fix refresh after addCredential
This commit is contained in:
parent
a644ce9804
commit
bddf5d9074
@ -179,21 +179,8 @@ class _AndroidCredentialListNotifier extends OathCredentialListNotifier {
|
||||
await _api.addAccount(credentialUri.toString(), requireTouch);
|
||||
|
||||
var result = jsonDecode(resultString);
|
||||
final newCredential = OathCredential.fromJson(result['credential']);
|
||||
final newCode =
|
||||
result['code'] != null ? OathCode.fromJson(result['code']) : null;
|
||||
final pair = OathPair(newCredential, newCode);
|
||||
|
||||
if (mounted) {
|
||||
final newState = state!.toList();
|
||||
|
||||
/// remove any duplicates to our new credential
|
||||
newState.removeWhere((e) => e.credential == newCredential);
|
||||
newState.add(pair);
|
||||
state = newState;
|
||||
}
|
||||
|
||||
return pair.credential;
|
||||
refresh();
|
||||
return OathCredential.fromJson(result['credential']);
|
||||
}
|
||||
|
||||
@override
|
||||
|
Loading…
Reference in New Issue
Block a user