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