From 592bea9eada788acec6813ae13c10e9439f5579f Mon Sep 17 00:00:00 2001 From: JulianAlcala Date: Wed, 13 May 2026 05:32:01 -0500 Subject: [PATCH] fix --- .../control_panel/presentation/control_panel_screen.dart | 1 + .../src/features/location/presentation/widgets/location_map.dart | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/legacy/modules/control_panel/lib/src/features/control_panel/presentation/control_panel_screen.dart b/modules/legacy/modules/control_panel/lib/src/features/control_panel/presentation/control_panel_screen.dart index 280cefe3..760b3550 100644 --- a/modules/legacy/modules/control_panel/lib/src/features/control_panel/presentation/control_panel_screen.dart +++ b/modules/legacy/modules/control_panel/lib/src/features/control_panel/presentation/control_panel_screen.dart @@ -257,6 +257,7 @@ class _MapSection extends ConsumerWidget { IconButton( onPressed: () async { if (!await guardDeviceCommand(context, ref)) return; + if (!context.mounted) return; final device = ref .read(legacyDeviceViewModelProvider) .value diff --git a/modules/legacy/modules/location/lib/src/features/location/presentation/widgets/location_map.dart b/modules/legacy/modules/location/lib/src/features/location/presentation/widgets/location_map.dart index a6fa59d8..41184091 100644 --- a/modules/legacy/modules/location/lib/src/features/location/presentation/widgets/location_map.dart +++ b/modules/legacy/modules/location/lib/src/features/location/presentation/widgets/location_map.dart @@ -954,6 +954,7 @@ class _LocationMapState extends ConsumerState child: GpsControlPanel( onRefresh: () async { if (!await guardDeviceCommand(context, ref)) return; + if (!mounted) return; unawaited( ref.read(sfTrackingProvider).legacyLocationMapRefreshTapped(), );