diff --git a/src/pages/tips/hide-and-seek/problem.astro b/src/pages/tips/hide-and-seek/problem.astro index 4b3807c..2294689 100644 --- a/src/pages/tips/hide-and-seek/problem.astro +++ b/src/pages/tips/hide-and-seek/problem.astro @@ -44,12 +44,13 @@ import "./_problem_styles.css"; ]; addEventListener("pagereveal", (event) => { - const from = new URL(navigation.activation.from.url, location.href); - if ( - event.viewTransition && - from.pathname !== "/tips/hide-and-seek/problem/" - ) { - event.viewTransition.skipTransition?.(); + if (event.viewTransition) { + if ( + new URL(navigation.activation.from.url, location.href).pathname !== + "/tips/hide-and-seek/problem/" + ) { + event.viewTransition.skipTransition?.(); + } } const scrollInfo = JSON.parse( sessionStorage.getItem("vtbag-hide-seek") || diff --git a/src/pages/tips/hide-and-seek/solution.astro b/src/pages/tips/hide-and-seek/solution.astro index 7221636..11dea75 100644 --- a/src/pages/tips/hide-and-seek/solution.astro +++ b/src/pages/tips/hide-and-seek/solution.astro @@ -43,12 +43,13 @@ import "./_solution_styles.css"; ]; addEventListener("pagereveal", (event) => { - const from = new URL(navigation.activation.from.url, location.href); - if ( - event.viewTransition && - from.pathname !== "/tips/hide-and-seek/solution/" - ) { - event.viewTransition.skipTransition?.(); + if (event.viewTransition) { + if ( + new URL(navigation.activation.from.url, location.href).pathname !== + "/tips/hide-and-seek/solution/" + ) { + event.viewTransition.skipTransition?.(); + } } const scrollInfo = JSON.parse( sessionStorage.getItem("vtbag-hide-seek") ||