mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-02 02:29:59 +00:00
6 lines
222 B
TypeScript
6 lines
222 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);
|
||
|
}
|