mirror of
https://github.com/imputnet/cobalt.git
synced 2026-02-08 23:16:48 +00:00
web: make everything ssr-compatible
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { derived, readable, type Updater } from 'svelte/store';
|
||||
import { browser } from '$app/environment';
|
||||
import { merge } from 'ts-deepmerge';
|
||||
|
||||
import type {
|
||||
@@ -43,6 +44,9 @@ const migrate = (settings: AllPartialSettingsWithSchema): PartialSettings => {
|
||||
|
||||
|
||||
const loadFromStorage = () => {
|
||||
if (!browser)
|
||||
return {};
|
||||
|
||||
const settings = localStorage.getItem('settings');
|
||||
if (!settings) {
|
||||
const migrated = migrateOldSettings();
|
||||
|
||||
Reference in New Issue
Block a user