Skip to content

Commit

Permalink
refactor: Default bitness on the download page (nodejs#6670)
Browse files Browse the repository at this point in the history
refactor: review updates
  • Loading branch information
canerakdas authored Apr 24, 2024
1 parent a48096b commit b092695
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/Downloads/Release/BitnessDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b092695

Please sign in to comment.