From 8e192b6ea6a37fd68cba6a8f00622f72b069a781 Mon Sep 17 00:00:00 2001 From: Jigar-f Date: Mon, 9 Dec 2024 17:19:34 +0530 Subject: [PATCH] Show UI after flashlight init fail. --- lib/features/vpn/vpn_notifier.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/features/vpn/vpn_notifier.dart b/lib/features/vpn/vpn_notifier.dart index 179bbc64b..79d1be49a 100644 --- a/lib/features/vpn/vpn_notifier.dart +++ b/lib/features/vpn/vpn_notifier.dart @@ -42,8 +42,17 @@ class VPNChangeNotifier with ChangeNotifier { if (configNotifier == null) { return; } + + if (timer!.tick >= 6) { + // Timer has reached 6 seconds + // Stop the timer and set isFlashlightInitialized to true + appLogger.i("flashlight fail initialized"); + isFlashlightInitialized = true; + isFlashlightInitializedFailed = true; + notifyListeners(); + } updateStatus( - configNotifier.fetchedProxiesConfig, + false, configNotifier.fetchedGlobalConfig, configNotifier.hasSucceedingProxy); });