Skip to content

Commit 1adb8f4

Browse files
committed
refactor getGateDisplayCount
1 parent 7ba4983 commit 1adb8f4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dotcom-rendering/src/components/SignInGateSelector.importable.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,11 @@ const decideShowDefaultGate = (): ShowGateValues => {
375375
};
376376

377377
const getGateDisplayCount = (): number => {
378-
const rawValue = storage.local.getRaw('gate_display_count');
379-
const count = parseInt(rawValue ?? '0', 10);
380-
return count;
378+
const count = parseInt(storage.local.getRaw('gate_display_count'), 10);
379+
if (Number.isInteger(count)) {
380+
return count;
381+
}
382+
return 0;
381383
};
382384

383385
const incrementGateDisplayCount = () => {

0 commit comments

Comments
 (0)