Fixed connecting state assignment bug

This commit is contained in:
2026-07-29 18:27:49 +01:00
parent 82b592dd9c
commit 660b76f82d

View File

@@ -148,13 +148,14 @@ def findDiskNode(serial: str) -> str | None:
def mountDisk(state: AppState) -> None:
state.diskState = "connecting"
node = findDiskNode(state.config.diskSerial)
try:
subprocess.run(
["mkdir", "-p", f"/mnt/{state.config.diskSerial}"],
check=True,
)
sleep(2)
sleep(1)
subprocess.run(
[
"mount",
@@ -165,7 +166,7 @@ def mountDisk(state: AppState) -> None:
],
check=True,
)
sleep(2)
sleep(1)
except subprocess.CalledProcessError:
pass
else:
@@ -233,7 +234,6 @@ def main() -> None:
and event.event == "connected"
and event.serial == state.config.diskSerial
):
state.diskState == "connecting"
mountDisk(state)
except Empty: