File tree Expand file tree Collapse file tree 4 files changed +25
-4
lines changed
email/presentation/action
mailbox_dashboard/presentation Expand file tree Collapse file tree 4 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -147,3 +147,5 @@ class SyncUpdateLabelForEmailOnMemory extends EmailUIAction {
147147 shouldRemove,
148148 ];
149149}
150+
151+ class RefreshEmailListViewOnForceEmailQueryAction extends EmailUIAction {}
Original file line number Diff line number Diff line change @@ -949,7 +949,6 @@ class MailboxDashBoardController extends ReloadableController
949949 }
950950
951951 loadLinagoraEcosystem ();
952- loadPreferencesSetting ();
953952 }
954953
955954 void _handleMailtoURL (MailtoArguments arguments) {
@@ -2127,6 +2126,7 @@ class MailboxDashBoardController extends ReloadableController
21272126 sessionCurrent != null ) {
21282127 labelController.checkLabelSettingState (sessionCurrent! , accountId.value! );
21292128 }
2129+ loadPreferencesSetting ();
21302130 }
21312131
21322132 Future <List <PresentationEmail >> quickSearchEmails (String query) async {
@@ -3463,7 +3463,16 @@ class MailboxDashBoardController extends ReloadableController
34633463 @override
34643464 OnPreferencesSettingChanged get onPreferencesSettingChanged => ({bool isThreadStateChanged = false }) {
34653465 log ('MailboxDashBoardController::onPreferencesSettingChanged: isThreadStateChanged = $isThreadStateChanged ' );
3466- };
3466+ if (isThreadStateChanged &&
3467+ forceEmailQuery &&
3468+ ! searchController.isSearchEmailRunning) {
3469+ _syncEmailListViewOnForceEmailQuery ();
3470+ }
3471+ };
3472+
3473+ void _syncEmailListViewOnForceEmailQuery () {
3474+ dispatchEmailUIAction (RefreshEmailListViewOnForceEmailQueryAction ());
3475+ }
34673476
34683477 @override
34693478 void onClose () {
Original file line number Diff line number Diff line change 11import 'package:core/utils/app_logger.dart' ;
2+ import 'package:core/utils/platform_info.dart' ;
23import 'package:tmail_ui_user/features/base/base_controller.dart' ;
34import 'package:tmail_ui_user/features/base/mixin/emit_state_mixin.dart' ;
45import 'package:tmail_ui_user/features/manage_account/domain/model/preferences/preferences_setting.dart' ;
56import 'package:tmail_ui_user/features/manage_account/domain/state/get_local_settings_state.dart' ;
67import 'package:tmail_ui_user/features/manage_account/domain/usecases/get_local_settings_interactor.dart' ;
78import 'package:tmail_ui_user/main/routes/route_navigation.dart' ;
9+ import 'package:tmail_ui_user/main/utils/app_config.dart' ;
810
911typedef OnPreferencesSettingChanged = void Function ({
1012 bool isThreadStateChanged,
@@ -22,6 +24,9 @@ mixin SetupPreferencesSettingMixin on EmitStateMixin {
2224 bool ? get isThreadDetailEnabled =>
2325 _preferencesSetting? .isThreadDetailEnabled == true ;
2426
27+ bool get forceEmailQuery =>
28+ PlatformInfo .isWeb && AppConfig .isForceEmailQueryEnabled;
29+
2530 void _setPreferencesSetting (PreferencesSetting setting) =>
2631 _preferencesSetting = setting;
2732
Original file line number Diff line number Diff line change @@ -358,6 +358,11 @@ class ThreadController extends BaseController with EmailActionController {
358358 } else if (action is RefreshAllEmailAction ) {
359359 refreshAllEmail (shouldClearCache: PlatformInfo .isWeb);
360360 mailboxDashBoardController.clearEmailUIAction ();
361+ } else if (action is RefreshEmailListViewOnForceEmailQueryAction ) {
362+ consumeState (Stream .value (Right (GetAllEmailLoading ())));
363+ resetToOriginalValue ();
364+ getAllEmailAction (forceEmailQuery: forceEmailQuery);
365+ mailboxDashBoardController.clearEmailUIAction ();
361366 }
362367 });
363368
@@ -537,7 +542,7 @@ class ThreadController extends BaseController with EmailActionController {
537542 logWarning ('ThreadController::_handleErrorGetAllOrRefreshChangesEmail():Error: $error ' );
538543 if (error is CannotCalculateChangesMethodResponseException ) {
539544 await cachingManager.clearAllEmailAndStateCache ();
540- getAllEmailAction ();
545+ getAllEmailAction (forceEmailQuery : forceEmailQuery );
541546 } else if (error is MethodLevelErrors ) {
542547 if (currentOverlayContext != null && error.message != null ) {
543548 appToast.showToastErrorMessage (
@@ -707,7 +712,7 @@ class ThreadController extends BaseController with EmailActionController {
707712 if (searchController.isSearchEmailRunning) {
708713 _searchEmail (limit: limitEmailFetched);
709714 } else {
710- getAllEmailAction ();
715+ getAllEmailAction (forceEmailQuery : forceEmailQuery );
711716 }
712717 }
713718
You can’t perform that action at this time.
0 commit comments