From b81485a3d5690a11bca49685af68cb5daf592ec2 Mon Sep 17 00:00:00 2001 From: "D. Scott Boggs" Date: Wed, 21 Jun 2023 06:23:36 -0400 Subject: [PATCH] Cleanly disconnect from the update stream if possible --- client/src/state.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/state.ts b/client/src/state.ts index d9c00e7..cc140cd 100644 --- a/client/src/state.ts +++ b/client/src/state.ts @@ -49,6 +49,7 @@ export const state = reactive({ error(event) window.location = window.location }) + window.addEventListener('beforeunload', () => source.close()) }, async repopulate() { this.state = State.Fetching