Skip to content

Commit 11300c7

Browse files
committed
Fix VTX status
1 parent 516fc45 commit 11300c7

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

locales/en/messages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6099,6 +6099,10 @@
60996099
"message": "Save",
61006100
"description": "Save button in the VTX tab"
61016101
},
6102+
"vtxButtonSaving": {
6103+
"message": "Saving",
6104+
"description": "Show state of the Save button in the VTX tab"
6105+
},
61026106
"vtxButtonSaved": {
61036107
"message": "Saved",
61046108
"description": "Saved action button in the VTX tab"

src/js/tabs/vtx.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -885,13 +885,19 @@ vtx.initialize = function (callback) {
885885

886886
TABS.vtx.vtxTableSavePending = false;
887887

888-
const oldText = $("#save_button").text();
889-
$("#save_button").html(i18n.getMessage('vtxButtonSaved'));
890-
setTimeout(function () {
891-
$("#save_button").html(oldText);
892-
}, 2000);
888+
const saveButton = $("#save_button");
889+
const oldText = saveButton.text();
890+
891+
saveButton.html(i18n.getMessage('vtxButtonSaving'));
893892

894-
TABS.vtx.initialize();
893+
setTimeout(() => {
894+
saveButton.html(i18n.getMessage('vtxButtonSaved'));
895+
896+
setTimeout(() => {
897+
saveButton.html(oldText);
898+
TABS.vtx.initialize();
899+
}, 2000); // Allow firmware to make relevant changes before initialization
900+
}, 2000);
895901
}
896902
}
897903

0 commit comments

Comments
 (0)