Skip to content

Commit 0546d57

Browse files
committed
Add mounted checks after async operations
1 parent a46a26d commit 0546d57

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/features/order/notfiers/abstract_mostro_notifier.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ class AbstractMostroNotifier extends StateNotifier<OrderState> {
164164
final sessionNotifier = ref.read(sessionNotifierProvider.notifier);
165165
await sessionNotifier.deleteSession(orderId);
166166

167+
// Check if still mounted after async operation
168+
if (!mounted) return;
169+
167170
logger.i('Session deleted for canceled order $orderId');
168171

169172
// Show cancellation notification

0 commit comments

Comments
 (0)