Fix: 修复平板下烧录按钮可见以及提示信息显示异常
This commit is contained in:
@@ -239,7 +239,14 @@ class App extends Component {
|
|||||||
id: 'command-burn-btn',
|
id: 'command-burn-btn',
|
||||||
displayText: Msg.Lang['nav.btn.burn'],
|
displayText: Msg.Lang['nav.btn.burn'],
|
||||||
preconditionFn: () => {
|
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(),
|
callback: () => BU.initBurn(),
|
||||||
scopeType: Nav.Scope.LEFT,
|
scopeType: Nav.Scope.LEFT,
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ BU.burnWithEsptool = async (binFile, erase) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const port = Serial.getPort(portName);
|
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 });
|
layer.msg(Msg.Lang['burn.notSupport'], { time: 1000 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -370,7 +370,7 @@ BU.burnWithAdafruitEsptool = async (binFile, erase) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const port = Serial.getPort(portName);
|
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 });
|
layer.msg(Msg.Lang['burn.notSupport'], { time: 1000 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user