1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 12:25:13 +03:00

Update defaults_dialog.js

Fixes the bug where clicking "Keep current settings" will stop configurators working until reboot.
This commit is contained in:
Darren Lines 2021-12-18 18:59:56 +00:00
parent c9d7b6ba85
commit 22674c338b

View file

@ -13,6 +13,7 @@ helper.defaultsDialog = (function () {
let data = [{
"title": 'Mini Quad with 3"-7" propellers',
"id": 2,
"notRecommended": false,
"reboot": true,
"settings": [
@ -578,6 +579,7 @@ helper.defaultsDialog = (function () {
},
{
"title": 'Rovers & Boats',
"id": 1,
"notRecommended": false,
"reboot": true,
"settings": [
@ -641,6 +643,7 @@ helper.defaultsDialog = (function () {
},
{
"title": 'Keep current settings (Not recommended)',
"id": 0,
"notRecommended": true,
"reboot": false,
"settings": [
@ -721,6 +724,11 @@ helper.defaultsDialog = (function () {
let selectedDefaultPreset = data[$(event.currentTarget).data("index")];
if (selectedDefaultPreset && selectedDefaultPreset.settings) {
if (selectedDefaultPreset.id == 0) {
// Close applying preset dialog if keeping current settings.
savingDefaultsModal.close();
}
mspHelper.loadBfConfig(function () {
privateScope.setFeaturesBits(selectedDefaultPreset)
});