From 23ae553203cc7caaad1e27d224875283cf988305 Mon Sep 17 00:00:00 2001 From: otsmr Date: Fri, 6 Jun 2025 10:22:25 +0200 Subject: [PATCH] fix timer --- lib/src/services/api.service.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/services/api.service.dart b/lib/src/services/api.service.dart index d9134ed..732126f 100644 --- a/lib/src/services/api.service.dart +++ b/lib/src/services/api.service.dart @@ -105,7 +105,7 @@ class ApiService { reconnectionTimer ??= Timer(Duration(seconds: _reconnectionDelay), () { Log.info("starting with reconnection."); reconnectionTimer = null; - connect(); + connect(force: true); }); _reconnectionDelay += 5; } @@ -126,6 +126,7 @@ class ApiService { return false; } reconnectionTimer?.cancel(); + reconnectionTimer = null; final user = await getUser(); if (user != null && user.isDemoUser) { globalCallbackConnectionState(true); @@ -137,6 +138,7 @@ class ApiService { } // ensure that the connect function is not called again by the timer. reconnectionTimer?.cancel(); + reconnectionTimer = null; isAuthenticated = false;