From 0aac693b5d51bc0db39e45eba1187c742f39f963 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 6 Mar 2026 08:08:01 -0800 Subject: [PATCH] fix(app): re-check connectivity on foreground resume to clear false-offline banner When backgrounded, the periodic TCP ping times out causing isOnline=false. On resume, immediately re-check so the banner clears as soon as the app is foregrounded rather than waiting up to 30s for the next scheduled check. Co-Authored-By: Claude Sonnet 4.6 --- it0_app/lib/core/router/app_router.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/it0_app/lib/core/router/app_router.dart b/it0_app/lib/core/router/app_router.dart index b7f8fe4..0215821 100644 --- a/it0_app/lib/core/router/app_router.dart +++ b/it0_app/lib/core/router/app_router.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../updater/update_service.dart'; +import '../network/connectivity_provider.dart'; import '../widgets/offline_banner.dart'; import '../../features/auth/data/providers/auth_provider.dart'; import '../../features/auth/presentation/pages/login_page.dart'; @@ -120,6 +121,8 @@ class _ScaffoldWithNavState extends ConsumerState @override void didChangeAppLifecycleState(AppLifecycleState state) { if (state == AppLifecycleState.resumed) { + // Re-check connectivity immediately on foreground to clear false-offline banner + ref.read(connectivityProvider.notifier).check(); _checkForUpdateIfNeeded(); } }