service: Do not restart the timer on regaining network connectivity

This commit is contained in:
PapaTutuWawa 2022-08-15 19:52:20 +02:00
parent 38cb61102a
commit 822e0ff565
2 changed files with 0 additions and 11 deletions

View File

@ -4,7 +4,6 @@ import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:get_it/get_it.dart';
import 'package:logging/logging.dart';
import 'package:meta/meta.dart';
import 'package:moxxyv2/service/connectivity_watcher.dart';
import 'package:moxxyv2/service/httpfiletransfer/httpfiletransfer.dart';
import 'package:moxxyv2/service/moxxmpp/reconnect.dart';
import 'package:moxxyv2/xmpp/connection.dart';
@ -42,8 +41,6 @@ class ConnectivityService {
.onConnectivityChanged(regained, lost);
GetIt.I.get<HttpFileTransferService>().onConnectivityChanged(regained);
GetIt.I.get<ConnectivityWatcherService>().onConnectivityChanged(regained);
});
}

View File

@ -36,14 +36,6 @@ class ConnectivityWatcherService {
_stopTimer();
_timer = Timer(const Duration(minutes: 30), _onTimerElapsed);
}
/// Called when the network state changed
Future<void> onConnectivityChanged(bool regained) async {
if (regained) {
_log.finest('Regained network connection. Starting warning timer...');
_startTimer();
}
}
/// Called when the XMPP connection state changed
Future<void> onConnectionStateChanged(XmppConnectionState before, XmppConnectionState current) async {