mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 20:35:19 +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:
parent
c9d7b6ba85
commit
22674c338b
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue