Skip to content

Commit

Permalink
增加握手失败提示
Browse files Browse the repository at this point in the history
  • Loading branch information
silenty4ng committed Nov 5, 2024
1 parent 0ac1599 commit 5aa4f35
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/components/navbar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@
alert(t('global.connectFail'));
return;
}
appStore.updateSettings({ connectPort: _connect });
const driversList : any = {};
Expand All @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/locale/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/locale/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export default {
'tool.scaned': '已扫码上传',
'global.nosupport': '当前浏览器不支持网页串口功能,请使用 Chrome, Edge, Opera 浏览器。',
'global.connectFail': '连接失败',
'global.handshakeFail': '握手失败',
'menu.workshop': '创意工坊',
'menu.firmware': '固件市场',
'menu.channel': '信道分享',
Expand Down

0 comments on commit 5aa4f35

Please sign in to comment.