diff --git a/lib/controller/stillbox.dart b/lib/controller/stillbox.dart index 9111270..20afb02 100644 --- a/lib/controller/stillbox.dart +++ b/lib/controller/stillbox.dart @@ -85,12 +85,12 @@ class Stillbox extends ChangeNotifier { if (connected == true) { return; } + channel.connect(_wsUri); channel.stream.listen((event) => _handleData(event), onDone: () { connected = false; }, onError: (error) => _handleError(error)); - channel.connect(_wsUri); connected = true; tgCache = TalkgroupCache(channel); notifyListeners();