From 7b9c7c3528665ba34aafeb646ab20320f2e786e7 Mon Sep 17 00:00:00 2001 From: Yash Kanakiya <76934250+yashkanakiya@users.noreply.github.com> Date: Thu, 24 Aug 2023 11:21:27 +0530 Subject: [PATCH] fix switch problem in mobile and installation step (#1262) --- resources/scripts/components/LightDarkSwitcher.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/scripts/components/LightDarkSwitcher.vue b/resources/scripts/components/LightDarkSwitcher.vue index 8273eb791..9a1fff396 100644 --- a/resources/scripts/components/LightDarkSwitcher.vue +++ b/resources/scripts/components/LightDarkSwitcher.vue @@ -16,6 +16,13 @@ defineProps({ const globalStore = useGlobalStore() +const isDark = ref( + localStorage.getItem('theme') === 'dark' + || document.documentElement.classList.contains('dark'), +) + +globalStore.isDarkModeOn = isDark + const enabled = computed({ get: () => globalStore.isDarkModeOn, set: (value) => {