You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Server was connected but became unavailable - mark as disconnected
1061
+
print("Server disconnected unexpectedly")
1062
+
self?.handleServerDisconnection()
1059
1063
}
1060
1064
}
1061
1065
}
1062
1066
}
1063
1067
}
1068
+
1069
+
privatefunc handleServerDisconnection(){
1070
+
isConnected =false
1071
+
isAttemptingConnection =false
1072
+
connectionAttemptTimer?.invalidate()
1073
+
connectionAttemptTimer =nil
1074
+
webSocketTask =nil
1075
+
1076
+
print("Updating UI to reflect server disconnection")
1077
+
updateConnectionStatusIcon()
1078
+
1079
+
// Optionally show a notification to the user
1080
+
letalert=UIAlertController(title:"Server Disconnected", message:"The connection to the server was lost. Please check your network and try reconnecting.", preferredStyle:.alert)
1081
+
alert.addAction(UIAlertAction(title:"Reconnect", style:.default){[weak self] _ in
0 commit comments