fix: Call `setTheme` function
This commit is contained in:
parent
581c122c82
commit
571d54a975
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Moon, Sun } from 'lucide-svelte';
|
import { Moon, Sun } from 'lucide-svelte';
|
||||||
import { theme } from '$lib/theme'
|
import { theme, setTheme } from '$lib/theme'
|
||||||
|
|
||||||
function toggleTheme() {
|
function toggleTheme() {
|
||||||
theme.update((currentTheme) => {
|
theme.update((currentTheme) => {
|
||||||
|
@ -14,6 +14,7 @@
|
||||||
} else {
|
} else {
|
||||||
document.documentElement.classList.add('dark');
|
document.documentElement.classList.add('dark');
|
||||||
}
|
}
|
||||||
|
setTheme(newTheme);
|
||||||
return newTheme
|
return newTheme
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue