feat(command): add settings page

zio/stable
三咲智子 2022-12-30 03:58:00 +08:00
parent 2332d7091a
commit fd93462f42
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
1 changed files with 12 additions and 0 deletions

View File

@ -240,6 +240,7 @@ export const useCommands = (cmds: () => CommandProvider[]) => {
export const provideGlobalCommands = () => { export const provideGlobalCommands = () => {
const { locale, t } = useI18n() const { locale, t } = useI18n()
const { locales } = useI18n() as { locales: ComputedRef<LocaleObject[]> } const { locales } = useI18n() as { locales: ComputedRef<LocaleObject[]> }
const router = useRouter()
const users = useUsers() const users = useUsers()
const masto = useMasto() const masto = useMasto()
const colorMode = useColorMode() const colorMode = useColorMode()
@ -258,6 +259,17 @@ export const provideGlobalCommands = () => {
}, },
}) })
useCommand({
scope: 'Navigation',
name: () => t('nav.settings'),
icon: 'i-ri:settings-4-line',
onActivate() {
router.push('/settings')
},
})
useCommand({ useCommand({
scope: 'Preferences', scope: 'Preferences',