From 88b795cbd39aeba47e6838bf57f6ac8fb9f41a48 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 3 Jul 2023 21:24:32 -0700 Subject: [PATCH] Small cleanup of parseInt --- components/mastery/AwakeningSelectWithInput/index.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/mastery/AwakeningSelectWithInput/index.tsx b/components/mastery/AwakeningSelectWithInput/index.tsx index 9a312fa0..d9671fb1 100644 --- a/components/mastery/AwakeningSelectWithInput/index.tsx +++ b/components/mastery/AwakeningSelectWithInput/index.tsx @@ -125,11 +125,9 @@ const AwakeningSelectWithInput = ({ const input = inputRef.current if (input && !handleInputError(parseFloat(input.value))) return - setCurrentLevel(parseInt(event.target.value)) - sendValues( - currentAwakening ? currentAwakening.id : '0', - parseInt(event.target.value) - ) + const newLevel = parseInt(event.target.value) + setCurrentLevel(newLevel) + sendValues(currentAwakening ? currentAwakening.id : '0', newLevel) } // Methods: Handle error