Skip to content

Commit

Permalink
fixup! TW-2046 fix display error with initial group name
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev committed Nov 20, 2024
1 parent ff75dcc commit 3523e34
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions lib/pages/chat_details/chat_details_edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -451,17 +451,19 @@ class ChatDetailsEditController extends State<ChatDetailsEdit>
}

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

return result.fold(
(failure) =>
failure is VerifyNameFailure ? failure.getMessage(context) : null,
(success) => null,
);
}

@override
Expand Down

0 comments on commit 3523e34

Please sign in to comment.