1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 14:25:14 +03:00

Fix expert mode

This commit is contained in:
Mark Haslinghuis 2022-04-01 23:44:20 +02:00
parent 2a7cc43c07
commit 2fb9308265

View file

@ -193,12 +193,6 @@ function finishClose(finishedCallback) {
// reset active sensor indicators // reset active sensor indicators
sensor_status(0); sensor_status(0);
// reset expert mode
ConfigStorage.get('permanentExpertMode', function (result) {
const checked = result.permanentExpertMode;
$('input[name="expertModeCheckbox"]').prop('checked', checked).trigger('change');
});
if (wasConnected) { if (wasConnected) {
// detach listeners and remove element data // detach listeners and remove element data
$('#content').empty(); $('#content').empty();
@ -232,17 +226,22 @@ function onOpen(openInfo) {
GUI.log(i18n.getMessage('serialPortOpened', serial.connectionType === 'serial' ? [serial.connectionId] : [openInfo.socketId])); GUI.log(i18n.getMessage('serialPortOpened', serial.connectionType === 'serial' ? [serial.connectionId] : [openInfo.socketId]));
// save selected port with chrome.storage if the port differs // save selected port with chrome.storage if the port differs
ConfigStorage.get('last_used_port', function (result) { let result = ConfigStorage.get('last_used_port');
if (result.last_used_port) { if (result.last_used_port) {
if (result.last_used_port !== GUI.connected_to) { if (result.last_used_port !== GUI.connected_to) {
// last used port doesn't match the one found in local db, we will store the new one // last used port doesn't match the one found in local db, we will store the new one
ConfigStorage.set({'last_used_port': GUI.connected_to});
}
} else {
// variable isn't stored yet, saving
ConfigStorage.set({'last_used_port': GUI.connected_to}); ConfigStorage.set({'last_used_port': GUI.connected_to});
} }
}); } else {
// variable isn't stored yet, saving
ConfigStorage.set({'last_used_port': GUI.connected_to});
}
// reset expert mode
result = ConfigStorage.get('permanentExpertMode');
if (result.permanentExpertMode) {
$('input[name="expertModeCheckbox"]').prop('checked', result.permanentExpertMode).trigger('change');
}
serial.onReceive.addListener(read_serial); serial.onReceive.addListener(read_serial);
setConnectionTimeout(); setConnectionTimeout();