From 14c331ab6e692ea3fcdaa056e32728f0a1cd2772 Mon Sep 17 00:00:00 2001 From: MAZE Date: Fri, 13 Sep 2024 19:59:29 +0330 Subject: [PATCH] fix: add default value --- src/components/modals/binaural/binaural.tsx | 8 ++++++-- src/components/modals/isochronic/isochronic.tsx | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/modals/binaural/binaural.tsx b/src/components/modals/binaural/binaural.tsx index 050a719..6c1e6d7 100644 --- a/src/components/modals/binaural/binaural.tsx +++ b/src/components/modals/binaural/binaural.tsx @@ -169,7 +169,9 @@ export function BinauralModal({ onClose, show }: BinauralProps) { step="0.1" type="number" value={baseFrequency} - onChange={e => setBaseFrequency(parseFloat(e.target.value))} + onChange={e => + setBaseFrequency(parseFloat(e.target.value || '0')) + } /> @@ -182,7 +184,9 @@ export function BinauralModal({ onClose, show }: BinauralProps) { step="0.1" type="number" value={beatFrequency} - onChange={e => setBeatFrequency(parseFloat(e.target.value))} + onChange={e => + setBeatFrequency(parseFloat(e.target.value || '0')) + } /> diff --git a/src/components/modals/isochronic/isochronic.tsx b/src/components/modals/isochronic/isochronic.tsx index 0d12fe7..0e0ed66 100644 --- a/src/components/modals/isochronic/isochronic.tsx +++ b/src/components/modals/isochronic/isochronic.tsx @@ -190,7 +190,9 @@ export function IsochronicModal({ onClose, show }: IsochronicProps) { step="0.1" type="number" value={baseFrequency} - onChange={e => setBaseFrequency(parseFloat(e.target.value))} + onChange={e => + setBaseFrequency(parseFloat(e.target.value || '0')) + } /> @@ -203,7 +205,9 @@ export function IsochronicModal({ onClose, show }: IsochronicProps) { step="0.1" type="number" value={beatFrequency} - onChange={e => setBeatFrequency(parseFloat(e.target.value))} + onChange={e => + setBeatFrequency(parseFloat(e.target.value || '0')) + } />