Merge pull request #323 from LemmyNet/fix/page-refresh

Don't restore scroll position on page refresh. Fixes #186
This commit is contained in:
Dessalines 2021-07-16 14:30:56 -04:00 committed by GitHub
commit 535bdf36c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,8 +43,11 @@ export class WebSocketService {
}).pipe(share());
if (isBrowser()) {
window.onbeforeunload = () => {
window.onunload = () => {
this.ws.close();
// Clears out scroll positions.
sessionStorage.clear();
};
}
}