mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-12-08 20:29:05 +00:00
Optimize mobile - Avoid creating unnecessary widgets (#268)
* Avoid creating unnecessary widgets * more flexible null handling and runtime errors prevention
This commit is contained in:
@@ -104,10 +104,9 @@ class WebsocketNotifier extends StateNotifier<WebscoketState> {
|
||||
disconnect() {
|
||||
debugPrint("[WEBSOCKET] Attempting to disconnect");
|
||||
var socket = state.socket?.disconnect();
|
||||
if (socket != null) {
|
||||
if (socket.disconnected) {
|
||||
state = WebscoketState(isConnected: false, socket: null);
|
||||
}
|
||||
|
||||
if (socket?.disconnected == true) {
|
||||
state = WebscoketState(isConnected: false, socket: null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user