From b55603a3e7665e8452891bfed63058bd39d1bbed Mon Sep 17 00:00:00 2001 From: hieubt Date: Wed, 20 Mar 2024 16:37:08 +0700 Subject: [PATCH] TW-1528: Close selection mode when click button and selection item is empty --- lib/pages/chat_list/chat_list.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index a48c44775b..10fa9d7132 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -210,6 +210,9 @@ class ChatListController extends State if (conversation != null && conversation.isSelected) { tempConversationSelectionPresentation.remove(conversation); + if (tempConversationSelectionPresentation.isEmpty) { + toggleSelectMode(); + } } else { tempConversationSelectionPresentation.add( ConversationSelectionPresentation( @@ -239,11 +242,7 @@ class ChatListController extends State } void onClickClearSelection() { - if (conversationSelectionNotifier.value.isNotEmpty) { - _clearSelectionItem(); - } else { - toggleSelectMode(); - } + toggleSelectMode(); } void resetActiveSpaceId() {