mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-01 18:19:55 +00:00
6 lines
223 B
TypeScript
6 lines
223 B
TypeScript
export default function restoreScrollPosition(context: any) {
|
|
const path: string = context.router.route.location.pathname;
|
|
const y = Number(sessionStorage.getItem(`scrollPosition_${path}`));
|
|
|
|
window.scrollTo(0, y);
|
|
}
|