mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Fix issues with WebSocket
This commit is contained in:
parent
e399f71a78
commit
459757b292
@ -67,6 +67,7 @@ class WebSocketHelper {
|
||||
// Clear Futures queue
|
||||
_requests.clear();
|
||||
|
||||
_ws = null;
|
||||
EventsHelper.emit(WSClosedEvent());
|
||||
},
|
||||
);
|
||||
|
@ -57,6 +57,8 @@ class _InitializeWidgetState extends SafeState<InitializeWidget> {
|
||||
/// Try to connect to server
|
||||
void _tryConnect() async {
|
||||
try {
|
||||
print("Attempting WebSocket connection...");
|
||||
|
||||
setState(() {
|
||||
_error = false;
|
||||
});
|
||||
@ -78,7 +80,7 @@ class _InitializeWidgetState extends SafeState<InitializeWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return !_error && WebSocketHelper.isConnected()
|
||||
return (!_error && WebSocketHelper.isConnected())
|
||||
? (isTablet(context)
|
||||
? TabletRoute(key: mainControllerKey)
|
||||
: SmartphoneMainRoute(key: mainControllerKey))
|
||||
|
Loading…
Reference in New Issue
Block a user