diff --git a/gui/dashboard/lib.js b/gui/dashboard/lib.js index 217a46e..26167ba 100644 --- a/gui/dashboard/lib.js +++ b/gui/dashboard/lib.js @@ -19,7 +19,17 @@ function createSettingsStore() { s.set(val); } - updateStorage(JSON.parse(window.localStorage.getItem('statusdash'))); + const localStorageString = window.localStorage.getItem('statusdash'); + let localStorage = {}; + + try { + localStorage = JSON.parse(localStorageString); + } + catch { + localStorage = {}; + } + + updateStorage(localStorage); return { subscribe: s.subscribe, diff --git a/lib/dashboard/build.js b/lib/dashboard/build.js index d5cf555..cf4a4e5 100644 --- a/lib/dashboard/build.js +++ b/lib/dashboard/build.js @@ -40,7 +40,7 @@ async function build() { }); const { output } = await bundle.generate({ - sourcemap: false, + sourcemap: true, format: 'iife', name: 'app', file: 'public/build/bundle.js',