feat: add many keyboard shortcuts
This commit is contained in:
@@ -6,7 +6,8 @@ import type { ModelWithProvider, ProviderWithModels } from '~/composables/useMod
|
||||
import { sortByReleaseDate } from '~/utils/sort';
|
||||
|
||||
const { openDialog } = useDialog();
|
||||
const { allModels } = await useModels();
|
||||
const { allModels } = useModels();
|
||||
const { addShortcut } = useKeyboardShortcuts();
|
||||
|
||||
const props = defineProps<{
|
||||
providers: ProviderWithModels[];
|
||||
@@ -213,6 +214,14 @@ const handleSearchKeyDown = (event: KeyboardEvent) => {
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
const unbindShortcut = addShortcut(['ctrl', 'shift', 'm'], () => {
|
||||
toggleDropdown();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
unbindShortcut();
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user