From 35f1b18e67a85c4e847c8a676eeab889e9a1a1d7 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 16 Jul 2021 09:05:28 -0400 Subject: [PATCH] Don't restore scroll position on page refresh. Fixes #186 --- src/shared/services/WebSocketService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shared/services/WebSocketService.ts b/src/shared/services/WebSocketService.ts index 1bf12fd..4c91d40 100644 --- a/src/shared/services/WebSocketService.ts +++ b/src/shared/services/WebSocketService.ts @@ -43,8 +43,11 @@ export class WebSocketService { }).pipe(share()); if (isBrowser()) { - window.onbeforeunload = () => { + window.onunload = () => { this.ws.close(); + + // Clears out scroll positions. + sessionStorage.clear(); }; } } -- 2.44.1