diff --git a/components/nav/NavBottomMoreMenu.vue b/components/nav/NavBottomMoreMenu.vue
index 82983be2..ab45b763 100644
--- a/components/nav/NavBottomMoreMenu.vue
+++ b/components/nav/NavBottomMoreMenu.vue
@@ -6,6 +6,7 @@ const emits = defineEmits<{
(event: 'update:modelValue', value: boolean): void
}>()
const visible = useVModel(props, 'modelValue', emits, { passive: true })
+const colorMode = useColorModeRef()
function changeShow() {
visible.value = !visible.value
@@ -22,6 +23,10 @@ function clickEvent(mouse: MouseEvent) {
}
}
+function toggleDark() {
+ colorMode.value = colorMode.value === 'dark' ? 'light' : 'dark'
+}
+
watch(visible, (val) => {
if (val && typeof document !== 'undefined')
document.addEventListener('click', clickEvent)
@@ -79,7 +84,7 @@ onBeforeUnmount(() => {
@click="toggleDark()"
>
- {{ !isDark ? $t('menu.toggle_theme.dark') : $t('menu.toggle_theme.light') }}
+ {{ colorMode === 'light' ? $t('menu.toggle_theme.dark') : $t('menu.toggle_theme.light') }}
diff --git a/components/publish/PublishEmojiPicker.client.vue b/components/publish/PublishEmojiPicker.client.vue
index 1e80c1ee..858d9f74 100644
--- a/components/publish/PublishEmojiPicker.client.vue
+++ b/components/publish/PublishEmojiPicker.client.vue
@@ -9,12 +9,13 @@ const emit = defineEmits<{
const el = $ref()
let picker = $ref()
+const colorMode = useColorModeRef()
async function openEmojiPicker() {
await updateCustomEmojis()
if (picker) {
picker.update({
- theme: isDark.value ? 'dark' : 'light',
+ theme: colorMode.value,
custom: customEmojisData.value,
})
}
@@ -28,7 +29,7 @@ async function openEmojiPicker() {
? emit('select', native)
: emit('selectCustom', { src, alt, 'data-emoji-id': name })
},
- theme: isDark.value ? 'dark' : 'light',
+ theme: colorMode.value,
custom: customEmojisData.value,
})
}
diff --git a/components/settings/SettingsColorMode.client.vue b/components/settings/SettingsColorMode.vue
similarity index 51%
rename from components/settings/SettingsColorMode.client.vue
rename to components/settings/SettingsColorMode.vue
index 59d947e5..7edae8b3 100644
--- a/components/settings/SettingsColorMode.client.vue
+++ b/components/settings/SettingsColorMode.vue
@@ -1,6 +1,10 @@
@@ -8,16 +12,16 @@ function setDark(v: boolean) {
diff --git a/composables/command.ts b/composables/command.ts
index a859682b..b0115c4a 100644
--- a/composables/command.ts
+++ b/composables/command.ts
@@ -206,6 +206,7 @@ export const provideGlobalCommands = () => {
const { locales } = useI18n() as { locales: ComputedRef