diff --git a/src/components/Practice/Mechanics3.jsx b/src/components/Practice/Mechanics3.jsx index 59011c36..e0dbffb1 100644 --- a/src/components/Practice/Mechanics3.jsx +++ b/src/components/Practice/Mechanics3.jsx @@ -218,7 +218,7 @@ const Mechanics2 = ({ }; const [currrentProgress, setCurrrentProgress] = React.useState(0); - const progressBarWidth = isNaN(currrentProgress / duration) + const progressBarWidth = Number.isNaN(currrentProgress / duration) ? 0 : currrentProgress / duration; diff --git a/src/components/Practice/Mechanics6.jsx b/src/components/Practice/Mechanics6.jsx index 850a8666..9b87bccb 100644 --- a/src/components/Practice/Mechanics6.jsx +++ b/src/components/Practice/Mechanics6.jsx @@ -144,8 +144,8 @@ const Mechanics2 = ({ } // if (type === "audio") { - const isSoundCorrect = word === wordToCheck ? true : false; - var audio = new Audio(isSoundCorrect ? correctSound : wrongSound); + const isSoundCorrect = word === wordToCheck; + let audio = new Audio(isSoundCorrect ? correctSound : wrongSound); if (!isSoundCorrect) { setEnableNext(false); } @@ -433,6 +433,7 @@ const Mechanics2 = ({ > {words?.map((elem) => (