From 3df4d3b85b19003a679f100f717905ec80e592c8 Mon Sep 17 00:00:00 2001 From: Yassine Fathi Date: Sun, 31 Dec 2023 17:29:58 +0100 Subject: [PATCH] Update default colorscheme in theme store --- src/stores/theme.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/stores/theme.ts b/src/stores/theme.ts index 81015d40..29daefa8 100644 --- a/src/stores/theme.ts +++ b/src/stores/theme.ts @@ -2,12 +2,14 @@ import { writable } from 'svelte/store'; import themes from '../../themes.json'; import type { Theme } from '../interfaces/theme'; -const defaultTheme: Theme = themes.find((t) => t.name === 'GruvboxDark')!; +const defaultColorscheme: Theme = themes.find((t) => t.name === 'GruvboxDark')!; export const theme = writable( - JSON.parse(localStorage.getItem('theme') || JSON.stringify(defaultTheme)), + JSON.parse( + localStorage.getItem('colorscheme') || JSON.stringify(defaultColorscheme), + ), ); theme.subscribe((value) => { - localStorage.setItem('theme', JSON.stringify(value)); + localStorage.setItem('colorscheme', JSON.stringify(value)); });