Skip to content

Commit 684536e

Browse files
committed
TF-3834 Persist sort order when reload page
Signed-off-by: dab246 <[email protected]>
1 parent f084397 commit 684536e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ class MailboxDashBoardController extends ReloadableController
372372
}
373373
_handleArguments();
374374
_loadAppGrid();
375-
loadStoredEmailSortOrder();
376375
super.onReady();
377376
}
378377

@@ -823,6 +822,7 @@ class MailboxDashBoardController extends ReloadableController
823822
notifyThreadDetailSettingUpdated();
824823
getServerSetting();
825824
cleanupRecentSearch();
825+
loadStoredEmailSortOrder();
826826

827827
if (PlatformInfo.isMobile) {
828828
getAllSendingEmails();

lib/features/thread/presentation/thread_controller.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,10 @@ class ThreadController extends BaseController with EmailActionController {
14251425
searchController.enableSearch();
14261426
if (searchQuery != null) {
14271427
searchController.updateTextSearch(searchQuery.value);
1428-
searchController.updateFilterEmail(textOption: Some(searchQuery));
1428+
searchController.updateFilterEmail(
1429+
textOption: Some(searchQuery),
1430+
sortOrderTypeOption: Some(mailboxDashBoardController.currentSortOrder),
1431+
);
14291432
if (currentContext != null) {
14301433
FocusScope.of(currentContext!).unfocus();
14311434
}
@@ -1440,7 +1443,10 @@ class ThreadController extends BaseController with EmailActionController {
14401443
dispatchState(Right(SearchingState()));
14411444
searchController.enableSearch();
14421445
searchController.updateTextSearch(searchQuery.value);
1443-
searchController.updateFilterEmail(textOption: Some(searchQuery));
1446+
searchController.updateFilterEmail(
1447+
textOption: Some(searchQuery),
1448+
sortOrderTypeOption: Some(mailboxDashBoardController.currentSortOrder),
1449+
);
14441450
if (currentContext != null) {
14451451
FocusScope.of(currentContext!).unfocus();
14461452
}

0 commit comments

Comments
 (0)