2023-03-09 17:08:43 +01:00
|
|
|
import { writable } from "svelte/store";
|
2023-03-11 16:52:48 +01:00
|
|
|
import { browser } from "$app/environment";
|
2023-03-09 17:08:43 +01:00
|
|
|
|
|
|
|
import type { MeUser } from "./api/entities";
|
|
|
|
|
2023-03-12 04:25:53 +01:00
|
|
|
const initialUserValue = null;
|
|
|
|
export const userStore = writable<MeUser | null>(initialUserValue);
|
2023-03-11 16:52:48 +01:00
|
|
|
|
|
|
|
let defaultThemeValue = "dark";
|
|
|
|
const initialThemeValue = browser
|
|
|
|
? window.localStorage.getItem("pronouns-theme") ?? defaultThemeValue
|
|
|
|
: defaultThemeValue;
|
|
|
|
|
|
|
|
export const themeStore = writable<string>(initialThemeValue);
|