File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
templates/flutter/lib/src Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,17 @@ mixin RealtimeMixin {
2828 _createSocket() async {
2929 final uri = _prepareUri();
3030 if (_websok == null) {
31- await getWebSocket(uri);
32- }
33- if (_lastUrl == uri.toString() && _websok?.closeCode == null) {
34- return;
31+ _websok = await getWebSocket(uri);
32+ _lastUrl = uri.toString();
33+ } else {
34+ if (_lastUrl == uri.toString() && _websok?.closeCode == null) {
35+ return;
36+ }
37+ await _closeConnection();
38+ _lastUrl = uri.toString();
39+ _websok = await getWebSocket(uri);
3540 }
36- await _closeConnection();
37- _lastUrl = uri.toString();
3841 print('subscription: $_lastUrl');
39- _websok = await getWebSocket(uri);
4042
4143 try {
4244 _websok?.stream.listen((response) {
You can’t perform that action at this time.
0 commit comments