Correct order once the tec_client disconnects to

stop watching the client first
This commit is contained in:
atse 2023-07-18 11:26:40 +08:00 committed by Tse Kwok Yan
parent 0aea353b7d
commit 0982ce0f92
1 changed files with 2 additions and 2 deletions

View File

@ -178,13 +178,13 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
return
await self._on_connection_changed(True)
else:
await self.tec_client.disconnect()
await self._on_connection_changed(False)
await self.tec_client.disconnect()
except (OSError, TimeoutError) as e:
logging.error(f"Failed communicating to {ip}:{port}: {e}")
await self.tec_client.disconnect()
await self._on_connection_changed(False)
await self.tec_client.disconnect()
async def coro_main():