mirror of
https://github.com/remvze/moodist.git
synced 2025-12-18 09:24:14 +00:00
fix: make share hotkey conditional
This commit is contained in:
parent
8307657628
commit
9ad49d021a
1 changed files with 4 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ import { ShareLinkModal } from '@/components/modals/share-link';
|
|||
import { PresetsModal } from '@/components/modals/presets';
|
||||
import { Notepad, Pomodoro } from '@/components/toolbox';
|
||||
import { fade, mix, slideY } from '@/lib/motion';
|
||||
import { useSoundStore } from '@/store';
|
||||
|
||||
import styles from './menu.module.css';
|
||||
import { useCloseListener } from '@/hooks/use-close-listener';
|
||||
|
|
@ -25,6 +26,8 @@ import { useCloseListener } from '@/hooks/use-close-listener';
|
|||
export function Menu() {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const noSelected = useSoundStore(state => state.noSelected());
|
||||
|
||||
const initial = useMemo(
|
||||
() => ({
|
||||
notepad: false,
|
||||
|
|
@ -56,7 +59,7 @@ export function Menu() {
|
|||
useHotkeys('shift+n', () => open('notepad'));
|
||||
useHotkeys('shift+p', () => open('pomodoro'));
|
||||
useHotkeys('shift+alt+p', () => open('presets'));
|
||||
useHotkeys('shift+s', () => open('shareLink'));
|
||||
useHotkeys('shift+s', () => open('shareLink'), { enabled: !noSelected });
|
||||
|
||||
useCloseListener(closeAll);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue