From b0926951931cd357dd7117fcdfbdf08dec448347 Mon Sep 17 00:00:00 2001 From: Caner Akdas Date: Thu, 25 Apr 2024 01:04:25 +0300 Subject: [PATCH] refactor: Default bitness on the download page (#6670) refactor: review updates --- components/Downloads/Release/BitnessDropdown.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/Downloads/Release/BitnessDropdown.tsx b/components/Downloads/Release/BitnessDropdown.tsx index 13520a4dd4af1..e6ddd46e6e822 100644 --- a/components/Downloads/Release/BitnessDropdown.tsx +++ b/components/Downloads/Release/BitnessDropdown.tsx @@ -79,11 +79,13 @@ const BitnessDropdown: FC = () => { if (currentBitnessExcluded && nonExcludedBitness) { // We set it as a Number for cases where it is 64 or 86 otherwise we are // setting it as a string (ARMv7, ARMv6, etc.) - if (Number.isNaN(Number(nonExcludedBitness)) === false) { - setBitness(Number(nonExcludedBitness)); - } else { - setBitness(nonExcludedBitness); - } + const numericBitness = Number(nonExcludedBitness); + + setBitness( + numericBitness.toString() === nonExcludedBitness + ? numericBitness + : nonExcludedBitness + ); } // we shouldn't react when "actions" change // eslint-disable-next-line react-hooks/exhaustive-deps