mirror of
https://github.com/smartyellow/status.git
synced 2025-06-28 04:35:11 +00:00
Local storage fallback
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user