From 85831d8d6ba51c19b4ae147922de40d241563d07 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Tue, 31 Aug 2021 16:00:25 +0200 Subject: [PATCH] I hate NaNs --- src/stores/gameActive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/gameActive.js b/src/stores/gameActive.js index c50912a..9e48f7d 100644 --- a/src/stores/gameActive.js +++ b/src/stores/gameActive.js @@ -6,6 +6,6 @@ gameActive.subscribe(t => { localStorage.setItem("game-active", t ? 1 : 0); }); const startPage = localStorage.getItem("dialog-page"); -const startPageIndex = Number(startPage) !== NaN ? Number(startPage) : dialog.findIndex(t => t.name === startPage); +const startPageIndex = !isNaN(Number(startPage)) ? Number(startPage) : dialog.findIndex(t => t.name === startPage); export const page = writable(startPageIndex !== -1 ? startPageIndex : 0); export const menuActive = writable(false); \ No newline at end of file