Fix duplicate entries
This commit is contained in:
parent
7c21089e03
commit
dabc6b1762
1 changed files with 7 additions and 4 deletions
|
@ -156,8 +156,12 @@ class AuthenticatorService {
|
|||
_logger.info("Adding new entry");
|
||||
final authEntity =
|
||||
await _gateway.createEntity(entity.encryptedData, entity.header);
|
||||
entity.copyWith(id: authEntity.id, shouldSync: false);
|
||||
await _db.updateLocalEntity(entity);
|
||||
await _db.updateLocalEntity(
|
||||
entity.copyWith(
|
||||
id: authEntity.id,
|
||||
shouldSync: false,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
_logger.info("Updating entry");
|
||||
await _gateway.updateEntity(
|
||||
|
@ -165,8 +169,7 @@ class AuthenticatorService {
|
|||
entity.encryptedData,
|
||||
entity.header,
|
||||
);
|
||||
entity.copyWith(shouldSync: false);
|
||||
await _db.updateLocalEntity(entity);
|
||||
await _db.updateLocalEntity(entity.copyWith(shouldSync: false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue