diff options
author | Miodec <[email protected]> | 2024-12-22 00:31:51 +0100 |
---|---|---|
committer | Miodec <[email protected]> | 2024-12-22 00:40:54 +0100 |
commit | c18feb07481af6152c445327105876760ed95dd0 (patch) | |
tree | 148a9acce06a40eddaffa56ee908ccbd27c88ad8 | |
parent | baaea33490e889c987844771de64a1fa9202e097 (diff) | |
download | monkeytype-c18feb07481af6152c445327105876760ed95dd0.tar.gz monkeytype-c18feb07481af6152c445327105876760ed95dd0.zip |
chore: add additional isAuthenticated check in case user logs out during the request
-rw-r--r-- | frontend/src/ts/db.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/frontend/src/ts/db.ts b/frontend/src/ts/db.ts index ff437e07f..8accd57c2 100644 --- a/frontend/src/ts/db.ts +++ b/frontend/src/ts/db.ts @@ -372,6 +372,9 @@ export async function getUserResults(offset?: number): Promise<boolean> { return false; } + //another check in case user logs out while waiting for response + if (!isAuthenticated()) return false; + const results: SnapshotResult<Mode>[] = response.body.data.map((result) => { if (result.bailedOut === undefined) result.bailedOut = false; if (result.blindMode === undefined) result.blindMode = false; |