diff --git a/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart b/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart index b60d7d7d2..9351f8b41 100644 --- a/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart +++ b/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart @@ -620,7 +620,7 @@ class MailboxDashBoardController extends ReloadableController return; } - if (PlatformInfo.isWeb) { + if (event is html.BeforeUnloadEvent) { await cachingManager.clearAllEmailAndStateCache(); } } diff --git a/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart b/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart index dfa531473..7aa1204cb 100644 --- a/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart +++ b/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart @@ -139,7 +139,7 @@ class ManageAccountDashBoardController extends ReloadableController @override Future onBeforeUnloadBrowserListener(html.Event event) async { - if (PlatformInfo.isWeb) { + if (event is html.BeforeUnloadEvent) { await cachingManager.clearAllEmailAndStateCache(); } }