1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-26 04:48:51 +00:00

Close WebSocket when InitWidget state is disposed

This commit is contained in:
Pierre HUBERT 2020-04-20 08:52:01 +02:00
parent 40cf1b1ddc
commit 159e7228bf

View File

@ -32,6 +32,12 @@ class _InitializeWidgetState extends SafeState<InitializeWidget> {
super.listen<WSClosedEvent>((e) => _tryConnect());
}
@override
void dispose() {
super.dispose();
WebSocketHelper.close();
}
/// Try to connect to server
void _tryConnect() async {
try {