From 340f2652f83b8f680245a6e3207cf9f5f32d60a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 27 Dec 2022 16:04:03 +0300 Subject: [PATCH] refactor --- middleware/route.global.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/route.global.js b/middleware/route.global.js index 3d2a54f4d..a763923e1 100644 --- a/middleware/route.global.js +++ b/middleware/route.global.js @@ -1,6 +1,6 @@ export default defineNuxtRouteMiddleware((to, from) => { useNuxtApp().hook('page:finish', () => { - if (to.path !== from.path && history.state) { + if (to.path !== from.path && history.state.scroll) { window.scrollTo(history.state.scroll); } else { window.scrollTo(0, 0);