diff --git a/components/klondike-solitaire.tsx b/components/klondike-solitaire.tsx index c6eae65..134d257 100644 --- a/components/klondike-solitaire.tsx +++ b/components/klondike-solitaire.tsx @@ -142,9 +142,10 @@ export function KlondikeSolitaireComponent() { }; const handleKeyPress = (e: React.KeyboardEvent) => { - if (gameWon) return; + const keyPressed = e.key.toLowerCase(); + if (gameWon && keyPressed != 'n') return; - switch (e.key.toLowerCase()) { + switch (keyPressed) { case 'd': drawCards(); break; @@ -255,4 +256,4 @@ export function KlondikeSolitaireComponent() { ); -} \ No newline at end of file +}