From 88d217f7875a47c146a6df3e0949704d1ea4aae2 Mon Sep 17 00:00:00 2001 From: dab246 Date: Thu, 29 Jan 2026 16:01:44 +0700 Subject: [PATCH] TF-4274 Fix logic clear cache email in onBeforeUnloadBrowserListener --- .../presentation/controller/mailbox_dashboard_controller.dart | 2 +- .../presentation/manage_account_dashboard_controller.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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(); } }