Improve USB connection handling by preventing connection attempts when already connected

This commit is contained in:
just_stuff_tm
2026-03-02 03:09:50 -05:00
committed by just-stuff-tm
parent 9a0572e8e4
commit 115689ad95
2 changed files with 93 additions and 66 deletions
+7
View File
@@ -425,6 +425,13 @@ class _UsbScreenState extends State<UsbScreen> {
if (selectedPort == null || selectedPort.isEmpty) {
return;
}
if (_connector.state != MeshCoreConnectionState.disconnected) {
setState(() {
_isConnecting = false;
_errorText = null;
});
return;
}
final rawPortName = normalizeUsbPortName(selectedPort);
setState(() {