diff --git a/packages/web/pages/settings/shortcuts.tsx b/packages/web/pages/settings/shortcuts.tsx index f42b6c792..bd43786a8 100644 --- a/packages/web/pages/settings/shortcuts.tsx +++ b/packages/web/pages/settings/shortcuts.tsx @@ -44,37 +44,6 @@ import { useResetShortcuts, } from '../../lib/networking/shortcuts/useShortcuts' -type ListAction = 'RESET' | 'ADD_ITEM' | 'REMOVE_ITEM' - -const SHORTCUTS_KEY = 'library-shortcuts' - -/** - * Use this function when you want to fix the "hydration" error in NextJS - * @param store - * @param callback - */ -export const useAsyncStore = ( - store: (callback: (state: T) => unknown) => unknown, - callback: (state: T) => F -) => { - const result = store(callback) as F - const [data, setData] = useState() - - useEffect(() => { - setData(typeof result === 'function' ? () => result : result) - }, [result]) - - return data -} - -/** - * Use this function when you want to fix the "hydration" error in NextJS - * @param key - */ -export const useAsyncStoreValue = (key: K) => { - return useAsyncStore(yourContextNameHere, (state) => state[key]) -} - function flattenShortcuts(shortcuts: Shortcut[]): string[] { let result: string[] = []