From cb257e1391325633acd818356f9e7fb77b8e4bb2 Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 1 May 2025 18:23:56 +0300 Subject: [PATCH] fix: allow address only edits (#2233) --- lib/view_model/contact_list/contact_view_model.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/view_model/contact_list/contact_view_model.dart b/lib/view_model/contact_list/contact_view_model.dart index efa1f09f4..2030cf03e 100644 --- a/lib/view_model/contact_list/contact_view_model.dart +++ b/lib/view_model/contact_list/contact_view_model.dart @@ -57,7 +57,11 @@ abstract class ContactViewModelBase with Store { state = IsExecutingState(); 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); return; }