Skip to content

Commit 8ecfedd

Browse files
committed
fix: fetch error
1 parent 7514b9d commit 8ecfedd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/pipeline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { CallAction, Flow } from '../types/flow';
66

77
export type HookFunc = (type: 'request' | 'response', text: any, flow: Flow) => DocumentFragment | HTMLElement | null | void;
88

9-
const originalFetch = unsafeWindow.fetch;
9+
const originalFetch = (typeof unsafeWindow !== 'undefined' ? unsafeWindow : window).fetch;
1010

1111
export function initRouteListener(hook: HookFunc) {
1212
listenUrlChange(async ({ uuid, action }) => {

0 commit comments

Comments
 (0)