Skip to content

Commit

Permalink
TW-2046 fix display error with initial group name
Browse files Browse the repository at this point in the history
  • Loading branch information
KhaledNjim committed Nov 19, 2024
1 parent 68f6d28 commit e1346a6
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions lib/pages/chat_details/chat_details_edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -451,19 +451,21 @@ class ChatDetailsEditController extends State<ChatDetailsEdit>
}

String? getErrorMessage(String content) {
return verifyNameInteractor.execute(
content,
[EmptyNameValidator(), NameWithSpaceOnlyValidator()],
).fold(
(failure) {
if (failure is VerifyNameFailure) {
return failure.getMessage(context);
} else {
return null;
}
},
(success) => null,
);
return content == room?.name
? null
: verifyNameInteractor.execute(
content,
[EmptyNameValidator(), NameWithSpaceOnlyValidator()],
).fold(
(failure) {
if (failure is VerifyNameFailure) {
return failure.getMessage(context);
} else {
return null;
}
},
(success) => null,
);
}

@override
Expand Down

0 comments on commit e1346a6

Please sign in to comment.