refactor: recreate collection and global hotkey contexts as store (using zustand)

This commit is contained in:
Sonny
2024-11-06 23:06:21 +01:00
committed by Sonny
parent 8bd87b5bba
commit 861906d29b
27 changed files with 247 additions and 148 deletions

View File

@@ -1,6 +1,6 @@
import KEYS from '#constants/keys';
import { useHotkeys } from 'react-hotkeys-hook';
import useGlobalHotkeys from '~/hooks/use_global_hotkeys';
import { useGlobalHotkeysStore } from '~/store/global_hotkeys_store';
type ShortcutOptions = {
enabled?: boolean;
@@ -15,7 +15,7 @@ export default function useShortcut(
disableGlobalCheck: false,
}
) {
const { globalHotkeysEnabled } = useGlobalHotkeys();
const { globalHotkeysEnabled } = useGlobalHotkeysStore();
return useHotkeys(
KEYS[key],
(event) => {