Fix: 修复平板下烧录按钮可见以及提示信息显示异常
This commit is contained in:
@@ -239,7 +239,14 @@ class App extends Component {
|
||||
id: 'command-burn-btn',
|
||||
displayText: Msg.Lang['nav.btn.burn'],
|
||||
preconditionFn: () => {
|
||||
return SELECTED_BOARD?.nav?.burn;
|
||||
if (goog.isElectron || Env.hasSocketServer) {
|
||||
return SELECTED_BOARD?.nav?.burn;
|
||||
}
|
||||
if (Serial.devicesRegistry.hasKey('serial')) {
|
||||
return SELECTED_BOARD?.nav?.burn;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
callback: () => BU.initBurn(),
|
||||
scopeType: Nav.Scope.LEFT,
|
||||
|
||||
@@ -250,7 +250,7 @@ BU.burnWithEsptool = async (binFile, erase) => {
|
||||
}
|
||||
}
|
||||
const port = Serial.getPort(portName);
|
||||
if (port instanceof window.HIDDevice || port instanceof window.USBDevice) {
|
||||
if (['HIDDevice', 'USBDevice'].includes(port.constructor.name)) {
|
||||
layer.msg(Msg.Lang['burn.notSupport'], { time: 1000 });
|
||||
return;
|
||||
}
|
||||
@@ -370,7 +370,7 @@ BU.burnWithAdafruitEsptool = async (binFile, erase) => {
|
||||
}
|
||||
}
|
||||
const port = Serial.getPort(portName);
|
||||
if (port instanceof window.HIDDevice || port instanceof window.USBDevice) {
|
||||
if (['HIDDevice', 'USBDevice'].includes(port.constructor.name)) {
|
||||
layer.msg(Msg.Lang['burn.notSupport'], { time: 1000 });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user