Skip to content

Commit 8769932

Browse files
committed
fix: add check for whether view transitions are supported
1 parent 431b203 commit 8769932

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/query/src/internal.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import type { scope as scopeFn } from "simple:scope";
2-
import { transitionEnabledOnThisPage } from "astro/virtual-modules/transitions-router.js";
2+
import {
3+
transitionEnabledOnThisPage,
4+
supportsViewTransitions,
5+
} from "astro/virtual-modules/transitions-router.js";
36

47
export function create$(scope: typeof scopeFn) {
58
const anyMatchSelector = `[data-target$=${JSON.stringify(scope())}`;
@@ -25,7 +28,7 @@ export function create$(scope: typeof scopeFn) {
2528
return [...document.querySelectorAll(selector)];
2629
},
2730
ready(callback: () => MaybePromise<undefined | (() => void)>) {
28-
if (transitionEnabledOnThisPage()) {
31+
if (supportsViewTransitions && transitionEnabledOnThisPage()) {
2932
let cleanup: (() => void) | undefined;
3033

3134
document.addEventListener("astro:page-load", async () => {

0 commit comments

Comments
 (0)