Skip to content

Commit 490dbbc

Browse files
committed
refactor getGateDisplayCount
1 parent 7ba4983 commit 490dbbc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,14 @@ 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(
379+
storage.local.getRaw('gate_display_count') ?? '0',
380+
10,
381+
);
382+
if (Number.isInteger(count)) {
383+
return count;
384+
}
385+
return 0;
381386
};
382387

383388
const incrementGateDisplayCount = () => {

0 commit comments

Comments
 (0)