diff --git a/src/components/navbar/index.vue b/src/components/navbar/index.vue index 465f52ae..38b7a24f 100644 --- a/src/components/navbar/index.vue +++ b/src/components/navbar/index.vue @@ -272,6 +272,7 @@ alert(t('global.connectFail')); return; } + appStore.updateSettings({ connectPort: _connect }); const driversList : any = {}; @@ -280,8 +281,15 @@ }) let _configuration = null; - - const version = await eeprom_init(_connect); + let version = ""; + try{ + version = await eeprom_init(_connect); + }catch{ + await disconnect(_connect); + appStore.updateSettings({ connectState: false, connectPort: null, firmwareVersion: "" }); + alert(t('global.handshakeFail')); + throw new Error(t('global.handshakeFail')); + } const config = { "name": "TODO", "uart": "official", diff --git a/src/locale/en-US.ts b/src/locale/en-US.ts index 67198a0e..aab60df4 100644 --- a/src/locale/en-US.ts +++ b/src/locale/en-US.ts @@ -140,7 +140,8 @@ export default { 'tool.scannotice': 'Uploaded location information will be cached by the server for 10 minutes', 'tool.scaned': 'Scanned and uploaded', 'global.nosupport': 'Current browser does not support WebSerial function, please use Chrome, Edge, Opera browser.', - 'global.connectFail': 'Connect Fail', + 'global.connectFail': 'Connect Failure', + 'global.handshakeFail': 'Handshake Failure', 'menu.workshop': 'Workshop', 'menu.firmware': 'Firmware Store', 'menu.channel': 'Channel Share', diff --git a/src/locale/zh-CN.ts b/src/locale/zh-CN.ts index d3a9ea16..85755748 100644 --- a/src/locale/zh-CN.ts +++ b/src/locale/zh-CN.ts @@ -141,6 +141,7 @@ export default { 'tool.scaned': '已扫码上传', 'global.nosupport': '当前浏览器不支持网页串口功能,请使用 Chrome, Edge, Opera 浏览器。', 'global.connectFail': '连接失败', + 'global.handshakeFail': '握手失败', 'menu.workshop': '创意工坊', 'menu.firmware': '固件市场', 'menu.channel': '信道分享',