don't add duplicated credentials

This commit is contained in:
Adam Velebil 2022-04-07 12:28:38 +02:00
parent b3403a2d17
commit 5eff51645d
No known key found for this signature in database
GPG Key ID: AC6D6B9D715FC084

View File

@ -185,13 +185,8 @@ class _AndroidCredentialListNotifier extends OathCredentialListNotifier {
if (mounted) {
final newState = state!.toList();
// this should not happen when adding a new credential
// but if we
final index = newState.indexWhere((e) => e.credential == newCredential);
if (index > 0) {
newState.removeAt(index);
}
/// remove any duplicates to our new credential
newState.removeWhere((e) => e.credential == newCredential);
newState.add(pair);
state = newState;
}