]> Untitled Git - lemmy-ui.git/blob - src/shared/utils/browser/restore-scroll-position.ts
Merge remote-tracking branch 'origin/main' into feat/vote-components
[lemmy-ui.git] / src / shared / utils / browser / restore-scroll-position.ts
1 export default function restoreScrollPosition(context: any) {
2   const path: string = context.router.route.location.pathname;
3   const y = Number(sessionStorage.getItem(`scrollPosition_${path}`));
4
5   window.scrollTo(0, y);
6 }