Skip to content

Commit

Permalink
Use groupedName and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Nov 18, 2024
1 parent 79a6519 commit 8dd138c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/js/tabs/firmware_flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,16 @@ firmware_flasher.initialize = function (callback) {
}

// extract osd protocols from general options and add to osdProtocols
data.osdProtocols = data.generalOptions.filter(option => option.group === 'OSD');
data.osdProtocols = data.generalOptions
.filter(option => option.group === 'OSD')
.map(option => {
option.name = option.groupedName;
option.default = self.cloudBuildOptions.includes(option.value);
return option;
});

// add None option to osdProtocols as first option
data.osdProtocols.unshift({name: 'None', value: ''});
// pre select osd option when found in general options after auto detect
if (self.cloudBuildOptions) {
data.osdProtocols.forEach((option) => {
option.default = self.cloudBuildOptions.includes(option.value);
});
}

// remove osdProtocols from generalOptions
data.generalOptions = data.generalOptions.filter(option => !option.group);
Expand Down

0 comments on commit 8dd138c

Please sign in to comment.