From 4493700c880939b110bed4da6b96726660758612 Mon Sep 17 00:00:00 2001 From: dab246 Date: Thu, 7 Oct 2021 14:49:33 +0700 Subject: [PATCH] TF-145 Update data from return stream every time for defaultMailbox --- .../mailbox/presentation/mailbox_controller.dart | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/features/mailbox/presentation/mailbox_controller.dart b/lib/features/mailbox/presentation/mailbox_controller.dart index 326374aee..bad344e58 100644 --- a/lib/features/mailbox/presentation/mailbox_controller.dart +++ b/lib/features/mailbox/presentation/mailbox_controller.dart @@ -82,21 +82,16 @@ class MailboxController extends BaseController { super.onData(newState); newState.map((success) { if (success is GetAllMailboxSuccess) { + currentMailboxState = success.currentMailboxState; + defaultMailboxList.value = success.defaultMailboxList; + _setUpMapMailboxIdDefault(success.defaultMailboxList); _buildTree(success.folderMailboxList); } }); } @override - void onDone() { - viewState.value.map((success) { - if (success is GetAllMailboxSuccess) { - currentMailboxState = success.currentMailboxState; - defaultMailboxList.value = success.defaultMailboxList; - _setUpMapMailboxIdDefault(success.defaultMailboxList); - } - }); - } + void onDone() {} @override void onError(error) {}