Skip to content

Commit

Permalink
fix: Fix settings modal ignoring undefined fields
Browse files Browse the repository at this point in the history
  • Loading branch information
cyperdark committed Oct 24, 2024
1 parent e704572 commit 31cff8d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/server/assets/homepage.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,14 +640,15 @@ const showSettings = {


setting.value.forEach((command, cmd_ind) => {
Object.entries(command).forEach(entry => {
const custom_value = value[cmd_ind][entry[0]];
if (custom_value == null) return;
if (entry[1] == custom_value) return;
setting.options.forEach(option => {
const original = setting.value[cmd_ind][option.name];
const modified = value[cmd_ind][option.name];

if (modified == null) return;
if (original == modified) return;

setting.value[cmd_ind][entry[0]] = custom_value;
});
setting.value[cmd_ind][option.name] = modified;
})
});


Expand Down

0 comments on commit 31cff8d

Please sign in to comment.