fix: allow address only edits (#2233)

This commit is contained in:
Serhii 2025-05-01 18:23:56 +03:00 committed by GitHub
parent 2a6dad2257
commit cb257e1391
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,7 +57,11 @@ abstract class ContactViewModelBase with Store {
state = IsExecutingState(); state = IsExecutingState();
final now = DateTime.now(); final now = DateTime.now();
if (doesContactNameExist(name)) { final nameExists = _contact == null
? doesContactNameExist(name)
: doesContactNameExist(name) && _contact.original.name != name;
if (nameExists) {
state = FailureState(S.current.contact_name_exists); state = FailureState(S.current.contact_name_exists);
return; return;
} }