Skip to content

Commit 80f8358

Browse files
committed
fix: default theme is incorrectly being set to dark
1 parent 6e5ea2d commit 80f8358

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ui/src/components/ThemeToggle.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<script setup>
22
import { ref } from 'vue'
33
4-
const theme=ref(localStorage.getItem('data-theme'))
4+
function getCurrentTheme() {
5+
let t = localStorage.getItem('data-theme')
6+
if (t === null) return 'light'
7+
return t
8+
}
9+
10+
const theme=ref(getCurrentTheme())
511
document.documentElement.setAttribute("data-theme", theme.value);
612
713
function onThemeToggle(){

0 commit comments

Comments
 (0)