Fix: logical error when connecting to the server

This commit is contained in:
LollipopKit
2021-10-31 22:01:36 +08:00
parent 6e3fca32db
commit 1cd69c8f44

View File

@@ -30,7 +30,7 @@ class ServerProvider extends BusyProvider {
ServerStatus get emptyStatus => ServerStatus( ServerStatus get emptyStatus => ServerStatus(
emptyCpu2Status, emptyCpu2Status,
[100, 0], [100, 0],
'', 'Loading...',
'', '',
[DiskInfo('/', '/', 0, '0', '0', '0')], [DiskInfo('/', '/', 0, '0', '0', '0')],
TcpStatus(0, 0, 0, 0)); TcpStatus(0, 0, 0, 0));
@@ -114,7 +114,7 @@ class ServerProvider extends BusyProvider {
final client = _servers[idx].client; final client = _servers[idx].client;
final connected = await client.isConnected(); final connected = await client.isConnected();
final state = _servers[idx].connectionState; final state = _servers[idx].connectionState;
if (!connected || state != ServerConnectionState.connected) { if (!connected || state == ServerConnectionState.failed || state == ServerConnectionState.disconnected) {
_servers[idx].connectionState = ServerConnectionState.connecting; _servers[idx].connectionState = ServerConnectionState.connecting;
notifyListeners(); notifyListeners();
final time1 = DateTime.now(); final time1 = DateTime.now();