shortcut set blank

This commit is contained in:
Gabe Yuan
2023-09-09 14:05:45 +08:00
parent 298e4b52f0
commit 54a14e6e5a
2 changed files with 6 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ import { useSetting } from "./Setting";
export function useShortcut(action) {
const { setting, updateSetting } = useSetting();
const shortcuts = setting?.shortcuts || DEFAULT_SHORTCUTS;
const shortcut = shortcuts[action] || [];
const setShortcut = useCallback(
async (val) => {
@@ -14,5 +15,5 @@ export function useShortcut(action) {
[action, shortcuts, updateSetting]
);
return { shortcut: shortcuts[action] || [], setShortcut };
return { shortcut, setShortcut };
}