TF-3834 Persist sort order when reload page

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-07-30 10:40:22 +07:00
committed by Dat H. Pham
parent 1293c1a997
commit 7aa7223049
2 changed files with 9 additions and 3 deletions
@@ -373,7 +373,6 @@ class MailboxDashBoardController extends ReloadableController
} }
_handleArguments(); _handleArguments();
_loadAppGrid(); _loadAppGrid();
loadStoredEmailSortOrder();
super.onReady(); super.onReady();
} }
@@ -825,6 +824,7 @@ class MailboxDashBoardController extends ReloadableController
notifyThreadDetailSettingUpdated(); notifyThreadDetailSettingUpdated();
getServerSetting(); getServerSetting();
cleanupRecentSearch(); cleanupRecentSearch();
loadStoredEmailSortOrder();
if (PlatformInfo.isMobile) { if (PlatformInfo.isMobile) {
getAllSendingEmails(); getAllSendingEmails();
@@ -1427,7 +1427,10 @@ class ThreadController extends BaseController with EmailActionController {
searchController.enableSearch(); searchController.enableSearch();
if (searchQuery != null) { if (searchQuery != null) {
searchController.updateTextSearch(searchQuery.value); searchController.updateTextSearch(searchQuery.value);
searchController.updateFilterEmail(textOption: Some(searchQuery)); searchController.updateFilterEmail(
textOption: Some(searchQuery),
sortOrderTypeOption: Some(mailboxDashBoardController.currentSortOrder),
);
if (currentContext != null) { if (currentContext != null) {
FocusScope.of(currentContext!).unfocus(); FocusScope.of(currentContext!).unfocus();
} }
@@ -1442,7 +1445,10 @@ class ThreadController extends BaseController with EmailActionController {
dispatchState(Right(SearchingState())); dispatchState(Right(SearchingState()));
searchController.enableSearch(); searchController.enableSearch();
searchController.updateTextSearch(searchQuery.value); searchController.updateTextSearch(searchQuery.value);
searchController.updateFilterEmail(textOption: Some(searchQuery)); searchController.updateFilterEmail(
textOption: Some(searchQuery),
sortOrderTypeOption: Some(mailboxDashBoardController.currentSortOrder),
);
if (currentContext != null) { if (currentContext != null) {
FocusScope.of(currentContext!).unfocus(); FocusScope.of(currentContext!).unfocus();
} }