From 4f652121529d630d9818cf567f72a408c45f8781 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Wed, 13 Jul 2022 11:21:59 +0200 Subject: [PATCH] Default settings --- gui/dashboard/lib.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gui/dashboard/lib.js b/gui/dashboard/lib.js index c9cff01..c8be324 100644 --- a/gui/dashboard/lib.js +++ b/gui/dashboard/lib.js @@ -3,14 +3,19 @@ import { quintOut } from 'svelte/easing'; import { crossfade } from 'svelte/transition'; function createSettingsStore() { - const s = writable({ + const defaults = { theme: 'dark', cols: 4, rows: 3, - }); + }; + + const s = writable(defaults); function updateStorage(val) { - window.localStorage.setItem('statusdash', JSON.stringify(val)); + window.localStorage.setItem('statusdash', { + ...defaults, + ...JSON.stringify(val), + }); s.set(val); }