fix: Add zen mode to preferences, remove shortcut (#2003)

This commit is contained in:
manuq 2023-04-23 07:21:33 -03:00 committed by GitHub
parent 9564985a4e
commit 56405f52bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 35 additions and 31 deletions

View file

@ -2,7 +2,6 @@ import type { RouteLocationRaw } from 'vue-router'
import { useMagicSequence } from '~/composables/magickeys'
export default defineNuxtPlugin(({ $scrollToTop }) => {
const userSettings = useUserSettings()
const keys = useMagicKeys()
const router = useRouter()
@ -23,7 +22,6 @@ export default defineNuxtPlugin(({ $scrollToTop }) => {
}
whenever(logicAnd(notUsingInput, keys['?']), toggleKeyboardShortcuts)
whenever(logicAnd(notUsingInput, keys.z), () => userSettings.value.zenMode = !userSettings.value.zenMode)
const defaultPublishDialog = () => {
const current = keys.current

View file

@ -10,7 +10,7 @@ export default defineNuxtPlugin(() => {
html.style.setProperty('--font-size', fontSize ? (oldFontSizeMap[fontSize as OldFontSize] ?? fontSize) : DEFAULT_FONT_SIZE)
})
watchEffect(() => {
html.classList.toggle('zen', userSettings.value.zenMode)
html.classList.toggle('zen', userSettings.value.preferences.zenMode)
})
watchEffect(() => {
Object.entries(userSettings.value.themeColors || {}).forEach(([k, v]) => html.style.setProperty(k, v))

View file

@ -25,7 +25,7 @@ export default defineNuxtPlugin(() => {
if (settings.language) {
html.setAttribute('lang', settings.language)
}
if (settings.zenMode) {
if (settings.preferences.zenMode) {
html.classList.add('zen')
}
if (settings.themeColors) {