From 7a2331717597400d8aa487c149555be76cd59760 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Fri, 24 Feb 2023 11:39:43 +0700 Subject: [PATCH] TF-1468: Add check expand mode of mailbox when trigger scroll --- lib/features/mailbox/presentation/mailbox_controller.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/features/mailbox/presentation/mailbox_controller.dart b/lib/features/mailbox/presentation/mailbox_controller.dart index c4bcb9c13..ce74d9d7e 100644 --- a/lib/features/mailbox/presentation/mailbox_controller.dart +++ b/lib/features/mailbox/presentation/mailbox_controller.dart @@ -214,6 +214,11 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM void _triggerScrollWhenExpandMailboxFolder(List childrenItems, MailboxNode selectedMailboxNode) async { await Future.delayed(const Duration(milliseconds: 200)); final _lastItem = childrenItems.last; + + if (selectedMailboxNode.expandMode == ExpandMode.COLLAPSE) { + return; + } + if (_lastItem.mailboxNameAsString.contains(selectedMailboxNode.mailboxNameAsString)) { mailboxListScrollController.animateTo( mailboxListScrollController.position.maxScrollExtent, @@ -903,7 +908,7 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM final newExpandMode = mailboxCategoriesExpandMode.value.teamMailboxes == ExpandMode.EXPAND ? ExpandMode.COLLAPSE : ExpandMode.EXPAND; mailboxCategoriesExpandMode.value.teamMailboxes = newExpandMode; mailboxCategoriesExpandMode.refresh(); - if (personalMailboxTree.value.root.hasChildren()) { + if (personalMailboxTree.value.root.hasChildren() && mailboxCategoriesExpandMode.value.teamMailboxes == ExpandMode.COLLAPSE) { _triggerToggleMailboxCategories(); } break;