diff --git a/src/components/menu/items/presets.tsx b/src/components/menu/items/presets.tsx index b3dd51c..a78b17d 100644 --- a/src/components/menu/items/presets.tsx +++ b/src/components/menu/items/presets.tsx @@ -11,7 +11,7 @@ export function Presets({ open }: PresetsProps) { } label="Your Presets" - shortcut="Shift + P" + shortcut="Shift + Alt + P" onClick={open} /> ); diff --git a/src/components/menu/items/sleep-timer.tsx b/src/components/menu/items/sleep-timer.tsx index 18fead6..0ecfa9b 100644 --- a/src/components/menu/items/sleep-timer.tsx +++ b/src/components/menu/items/sleep-timer.tsx @@ -15,7 +15,7 @@ export function SleepTimer({ open }: SleepTimerProps) { active={active} icon={} label="Sleep Timer" - shortcut="Shift + T" + shortcut="Shift + Alt + T" onClick={open} /> ); diff --git a/src/components/menu/menu.tsx b/src/components/menu/menu.tsx index 3a982ae..1b4d342 100644 --- a/src/components/menu/menu.tsx +++ b/src/components/menu/menu.tsx @@ -69,11 +69,14 @@ export function Menu() { ); useHotkeys('shift+m', () => setIsOpen(prev => !prev)); - useHotkeys('shift+p', () => open('presets')); + useHotkeys('shift+alt+p', () => open('presets')); useHotkeys('shift+h', () => open('shortcuts')); useHotkeys('shift+b', () => open('breathing')); + useHotkeys('shift+n', () => open('notepad')); + useHotkeys('shift+p', () => open('pomodoro')); + useHotkeys('shift+t', () => open('todo')); useHotkeys('shift+s', () => open('shareLink'), { enabled: !noSelected }); - useHotkeys('shift+t', () => open('sleepTimer')); + useHotkeys('shift+alt+t', () => open('sleepTimer')); useCloseListener(closeAll); diff --git a/src/components/modals/shortcuts/shortcuts.tsx b/src/components/modals/shortcuts/shortcuts.tsx index 0a8b57a..882999e 100644 --- a/src/components/modals/shortcuts/shortcuts.tsx +++ b/src/components/modals/shortcuts/shortcuts.tsx @@ -14,7 +14,7 @@ export function ShortcutsModal({ onClose, show }: ShortcutsModalProps) { label: 'Shortcuts List', }, { - keys: ['Shift', 'P'], + keys: ['Shift', 'Alt', 'P'], label: 'Presets', }, { @@ -22,9 +22,21 @@ export function ShortcutsModal({ onClose, show }: ShortcutsModalProps) { label: 'Share Sounds', }, { - keys: ['Shift', 'T'], + keys: ['Shift', 'Alt', 'T'], label: 'Sleep Timer', }, + { + keys: ['Shift', 'N'], + label: 'Notepad', + }, + { + keys: ['Shift', 'P'], + label: 'Pomodoro', + }, + { + keys: ['Shift', 'T'], + label: 'Todo Checklist', + }, { keys: ['Shift', 'B'], label: 'Breathing Exercise', diff --git a/src/stores/preset/index.ts b/src/stores/preset/index.ts index 2863869..c3bd953 100644 --- a/src/stores/preset/index.ts +++ b/src/stores/preset/index.ts @@ -40,32 +40,11 @@ export const usePresetStore = create()( { merge: (persisted, current) => merge(current, persisted as Partial), - - migrate, name: 'moodist-presets', partialize: state => ({ presets: state.presets }), skipHydration: true, storage: createJSONStorage(() => localStorage), - version: 1, + version: 0, }, ), ); - -function migrate(persistedState: unknown, version: number) { - let persisted = persistedState as Partial; - - /** - * In version 0, presets didn't have an ID - */ - if (version < 1) { - persisted = { - ...persisted, - presets: (persisted.presets || []).map(preset => { - if (preset.id) return preset; - return { ...preset, id: uuid() }; - }), - } as PresetStore; - } - - return persisted as PresetStore; -}