增加握手失败提示

This commit is contained in:
Silent YANG 2024-11-06 02:55:49 +08:00
parent 0ac159910b
commit 5aa4f35f17
3 changed files with 13 additions and 3 deletions

View file

@ -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",

View file

@ -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',

View file

@ -141,6 +141,7 @@ export default {
'tool.scaned': '已扫码上传',
'global.nosupport': '当前浏览器不支持网页串口功能,请使用 Chrome, Edge, Opera 浏览器。',
'global.connectFail': '连接失败',
'global.handshakeFail': '握手失败',
'menu.workshop': '创意工坊',
'menu.firmware': '固件市场',
'menu.channel': '信道分享',