From 31cff8d85a582b6222e691031f7497997172288f Mon Sep 17 00:00:00 2001 From: ck <21735205+cyperdark@users.noreply.github.com> Date: Thu, 24 Oct 2024 23:45:50 +0300 Subject: [PATCH] fix: Fix `settings modal` ignoring undefined fields --- packages/server/assets/homepage.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/server/assets/homepage.js b/packages/server/assets/homepage.js index ba92cf0f..005c1166 100644 --- a/packages/server/assets/homepage.js +++ b/packages/server/assets/homepage.js @@ -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; + }) });