diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index d99a15c397..ba1b0a4e1f 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -219,6 +219,11 @@ class ChatListController extends State _clearSelectionItem(); } + Future actionWithToggleSelectMode(Function action) async { + await action(); + toggleSelectMode(); + } + void _clearSelectionItem() { conversationSelectionNotifier.value = []; } @@ -255,7 +260,6 @@ class ChatListController extends State } }, ); - toggleSelectMode(); } Future toggleFavouriteRoom() async { @@ -272,7 +276,6 @@ class ChatListController extends State } }, ); - toggleSelectMode(); } Future toggleMuted() async { @@ -291,7 +294,6 @@ class ChatListController extends State } }, ); - toggleSelectMode(); } Future archiveAction() async { @@ -507,19 +509,20 @@ class ChatListController extends State ) async { switch (chatListBottomNavigatorBar) { case ChatListSelectionActions.read: - await toggleUnread(); - toggleSelectMode(); + await actionWithToggleSelectMode(toggleUnread); return; case ChatListSelectionActions.mute: - await toggleMuted(); - toggleSelectMode(); + await actionWithToggleSelectMode(toggleMuted); return; case ChatListSelectionActions.pin: - await toggleFavouriteRoom(); - toggleSelectMode(); + await actionWithToggleSelectMode(toggleFavouriteRoom); return; case ChatListSelectionActions.more: - toggleSelectMode(); + await actionWithToggleSelectMode( + () => { + TwakeSnackBar.show(context, 'Not implemented yet'), + }, + ); return; } }