diff options
author | Christian Fehmer <[email protected]> | 2024-07-02 23:16:16 +0200 |
---|---|---|
committer | Christian Fehmer <[email protected]> | 2024-07-02 23:16:16 +0200 |
commit | fcaa7bf30663e4c0830ef9e423bb70311dde1255 (patch) | |
tree | 71a04636f6cd6a805b2415777ea9a1e4396dbad1 | |
parent | ce093c538da0973350f2a7e76b671e032f87adf7 (diff) | |
download | monkeytype-fcaa7bf30663e4c0830ef9e423bb70311dde1255.tar.gz monkeytype-fcaa7bf30663e4c0830ef9e423bb70311dde1255.zip |
fix: error when loading account page and quickly navigating to another page (@fehmer)
-rw-r--r-- | frontend/src/ts/elements/test-activity.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/frontend/src/ts/elements/test-activity.ts b/frontend/src/ts/elements/test-activity.ts index 2557eee49..760330514 100644 --- a/frontend/src/ts/elements/test-activity.ts +++ b/frontend/src/ts/elements/test-activity.ts @@ -22,9 +22,12 @@ export function init( } function update(calendar?: MonkeyTypes.TestActivityCalendar): void { - const container = document.querySelector( - "#testActivity .activity" - ) as HTMLElement; + const container = document.querySelector("#testActivity .activity"); + + if (container === null) { + return; + } + container.innerHTML = ""; if (calendar === undefined) { |