From fd1da2eb3b68b57fcb36f39ed17e8d19a0c349e0 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 15 May 2022 21:15:08 +0900 Subject: [PATCH] refs #3300 Handle shortcut keys in Settings --- src/renderer/components/Settings.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/Settings.vue b/src/renderer/components/Settings.vue index 3e4e8c82..ffa8078b 100644 --- a/src/renderer/components/Settings.vue +++ b/src/renderer/components/Settings.vue @@ -13,7 +13,6 @@ -
import { defineComponent, computed, onMounted } from 'vue' +import { useMagicKeys, whenever } from '@vueuse/core' import { useRoute, useRouter } from 'vue-router' import { useStore } from '@/store' import { MUTATION_TYPES } from '@/store/Settings' @@ -56,6 +56,7 @@ export default defineComponent({ const store = useStore() const route = useRoute() const router = useRouter() + const { escape } = useMagicKeys() const primaryColor = computed(() => store.state.App.theme.primary_color) const backgroundColor = computed(() => store.state.App.theme.background_color) @@ -67,6 +68,10 @@ export default defineComponent({ router.push(`/${id.value}/settings/general`) }) + whenever(escape, () => { + close() + }) + const close = () => { router.push(`/${id.value}/home`) }