Skip to content

Commit

Permalink
Fix VTX status
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Oct 7, 2022
1 parent 516fc45 commit 6d3bbea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6099,6 +6099,10 @@
"message": "Save",
"description": "Save button in the VTX tab"
},
"vtxButtonSaving": {
"message": "Saving",
"description": "Show state of the Save button in the VTX tab"
},
"vtxButtonSaved": {
"message": "Saved",
"description": "Saved action button in the VTX tab"
Expand Down
20 changes: 14 additions & 6 deletions src/js/tabs/vtx.js
Original file line number Diff line number Diff line change
Expand Up @@ -885,13 +885,21 @@ vtx.initialize = function (callback) {

TABS.vtx.vtxTableSavePending = false;

const oldText = $("#save_button").text();
$("#save_button").html(i18n.getMessage('vtxButtonSaved'));
setTimeout(function () {
$("#save_button").html(oldText);
}, 2000);
const saveButton = $("#save_button");
const oldText = saveButton.text();
const buttonDelay = 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(() => {
saveButton.html(oldText).removeClass('disabled');
TABS.vtx.initialize();
}, buttonDelay);
}, buttonDelay);
}
}

Expand Down

0 comments on commit 6d3bbea

Please sign in to comment.