summaryrefslogtreecommitdiff
path: root/src/config/funcs.ts
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-01 14:44:25 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-01 14:44:25 +1100
commit9baca0e61bbd92b40e79fd9d49549f15cd91329c (patch)
tree16ffcda5fb46699e2c798ca6cb3a6492c52518a5 /src/config/funcs.ts
parentfeat: thumbnailer utility (diff)
downloadcaelestia-shell-9baca0e61bbd92b40e79fd9d49549f15cd91329c.tar.gz
caelestia-shell-9baca0e61bbd92b40e79fd9d49549f15cd91329c.tar.bz2
caelestia-shell-9baca0e61bbd92b40e79fd9d49549f15cd91329c.zip
config: lazy update arrays
Only set arrays if they are different
Diffstat (limited to 'src/config/funcs.ts')
-rw-r--r--src/config/funcs.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config/funcs.ts b/src/config/funcs.ts
index 72823eb..bf181fb 100644
--- a/src/config/funcs.ts
+++ b/src/config/funcs.ts
@@ -78,7 +78,7 @@ const updateSection = (from: { [k: string]: any }, to: { [k: string]: any }, pat
for (const [k, v] of Object.entries(from)) {
if (to.hasOwnProperty(k)) {
if (isObject(v)) updateSection(v, to[k], `${path}${k}.`);
- else to[k].set(v);
+ else if (!Array.isArray(v) || JSON.stringify(to[k].get()) !== JSON.stringify(v)) to[k].set(v);
} else console.warn(`Unknown config key: ${path}${k}`);
}
};