connect after

This commit is contained in:
Daniel 2024-10-18 09:10:44 -04:00
parent 58662a6fe0
commit dd86eef69f

View file

@ -85,12 +85,12 @@ class Stillbox extends ChangeNotifier {
if (connected == true) { if (connected == true) {
return; return;
} }
channel.connect(_wsUri);
channel.stream.listen((event) => _handleData(event), channel.stream.listen((event) => _handleData(event),
onDone: () { onDone: () {
connected = false; connected = false;
}, },
onError: (error) => _handleError(error)); onError: (error) => _handleError(error));
channel.connect(_wsUri);
connected = true; connected = true;
tgCache = TalkgroupCache(channel); tgCache = TalkgroupCache(channel);
notifyListeners(); notifyListeners();