Skip to content

Commit

Permalink
Fixes an TypeError when using without (#10456)
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Mar 15, 2024
1 parent 8a80dbf commit 1900a8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thirty-dancers-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Fixes an error when using `astro:transtions/client` without `<ViewTransitions/>`
2 changes: 1 addition & 1 deletion packages/astro/src/transitions/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ const onScrollEnd = () => {
// "scrollend" events. To avoid redundant work and expensive calls to
// `replaceState()`, we simply check that the values are different before
// updating.
if (scrollX !== history.state.scrollX || scrollY !== history.state.scrollY) {
if (history.state && (scrollX !== history.state.scrollX || scrollY !== history.state.scrollY)) {
updateScrollPosition({ scrollX, scrollY });
}
};
Expand Down

0 comments on commit 1900a8f

Please sign in to comment.