diff --git a/lib/helpers/websocket_helper.dart b/lib/helpers/websocket_helper.dart index 68305cf..1281928 100644 --- a/lib/helpers/websocket_helper.dart +++ b/lib/helpers/websocket_helper.dart @@ -67,6 +67,7 @@ class WebSocketHelper { // Clear Futures queue _requests.clear(); + _ws = null; EventsHelper.emit(WSClosedEvent()); }, ); diff --git a/lib/ui/widgets/init_widget.dart b/lib/ui/widgets/init_widget.dart index 54ae38a..c83f5b0 100644 --- a/lib/ui/widgets/init_widget.dart +++ b/lib/ui/widgets/init_widget.dart @@ -57,6 +57,8 @@ class _InitializeWidgetState extends SafeState { /// Try to connect to server void _tryConnect() async { try { + print("Attempting WebSocket connection..."); + setState(() { _error = false; }); @@ -78,7 +80,7 @@ class _InitializeWidgetState extends SafeState { @override Widget build(BuildContext context) { - return !_error && WebSocketHelper.isConnected() + return (!_error && WebSocketHelper.isConnected()) ? (isTablet(context) ? TabletRoute(key: mainControllerKey) : SmartphoneMainRoute(key: mainControllerKey))