diff --git a/src/components/save-combo-button/index.tsx b/src/components/save-combo-button/index.tsx index 0513f466..505acffd 100644 --- a/src/components/save-combo-button/index.tsx +++ b/src/components/save-combo-button/index.tsx @@ -16,11 +16,18 @@ export function SaveComboButton() { const [comboName, setComboName] = useState('') const [showSuccess, setShowSuccess] = useState(false) + const [showInput, setShowInput] = useState(false) function save() { - if (!comboName) return if (!sounds.some(sound => sound.active)) return + if (!showInput) { + setShowInput(true) + return + } + + if (!comboName) return + const activeSounds = sounds.filter(sound => sound.active) saveCombo({ @@ -30,6 +37,7 @@ export function SaveComboButton() { }) setComboName('') + setShowInput(false) setShowSuccess(true) setTimeout(() => setShowSuccess(false), 2000) @@ -39,7 +47,7 @@ export function SaveComboButton() { return (
- {sounds.some(sound => sound.active) && ( + {showInput && (