We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7514b9d commit 8ecfeddCopy full SHA for 8ecfedd
src/lib/pipeline.ts
@@ -6,7 +6,7 @@ import { CallAction, Flow } from '../types/flow';
6
7
export type HookFunc = (type: 'request' | 'response', text: any, flow: Flow) => DocumentFragment | HTMLElement | null | void;
8
9
-const originalFetch = unsafeWindow.fetch;
+const originalFetch = (typeof unsafeWindow !== 'undefined' ? unsafeWindow : window).fetch;
10
11
export function initRouteListener(hook: HookFunc) {
12
listenUrlChange(async ({ uuid, action }) => {
0 commit comments