mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 13:25:24 +03:00
Merge pull request #3034 from haslinghuis/fix-vtx-status
Fix VTX status update after saving
This commit is contained in:
commit
1efa12672b
2 changed files with 18 additions and 6 deletions
|
@ -6099,6 +6099,10 @@
|
||||||
"message": "Save",
|
"message": "Save",
|
||||||
"description": "Save button in the VTX tab"
|
"description": "Save button in the VTX tab"
|
||||||
},
|
},
|
||||||
|
"vtxButtonSaving": {
|
||||||
|
"message": "Saving",
|
||||||
|
"description": "Show state of the Save button in the VTX tab"
|
||||||
|
},
|
||||||
"vtxButtonSaved": {
|
"vtxButtonSaved": {
|
||||||
"message": "Saved",
|
"message": "Saved",
|
||||||
"description": "Saved action button in the VTX tab"
|
"description": "Saved action button in the VTX tab"
|
||||||
|
|
|
@ -885,13 +885,21 @@ vtx.initialize = function (callback) {
|
||||||
|
|
||||||
TABS.vtx.vtxTableSavePending = false;
|
TABS.vtx.vtxTableSavePending = false;
|
||||||
|
|
||||||
const oldText = $("#save_button").text();
|
const saveButton = $("#save_button");
|
||||||
$("#save_button").html(i18n.getMessage('vtxButtonSaved'));
|
const oldText = saveButton.text();
|
||||||
setTimeout(function () {
|
const buttonDelay = 2000;
|
||||||
$("#save_button").html(oldText);
|
|
||||||
}, 2000);
|
|
||||||
|
|
||||||
TABS.vtx.initialize();
|
saveButton.html(i18n.getMessage('vtxButtonSaving')).addClass('disabled');
|
||||||
|
|
||||||
|
// Allow firmware to make relevant changes before initialization
|
||||||
|
setTimeout(() => {
|
||||||
|
saveButton.html(i18n.getMessage('vtxButtonSaved'));
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
TABS.vtx.initialize();
|
||||||
|
saveButton.html(oldText).removeClass('disabled');
|
||||||
|
}, buttonDelay);
|
||||||
|
}, buttonDelay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue