From b3fe01f4d3d836157753a30fa931fa1cb8803e25 Mon Sep 17 00:00:00 2001 From: Pascal Date: Sun, 16 Aug 2026 09:07:08 +0200 Subject: [PATCH] ui: use arrow function in fetch interceptor --- tools/ui/src/lib/stores/webrtc.svelte.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/ui/src/lib/stores/webrtc.svelte.ts b/tools/ui/src/lib/stores/webrtc.svelte.ts index 295a7867cc..7daad880cf 100644 --- a/tools/ui/src/lib/stores/webrtc.svelte.ts +++ b/tools/ui/src/lib/stores/webrtc.svelte.ts @@ -199,8 +199,7 @@ class WebRTCStore { private installInterceptor(): void { if (this.originalFetch) return; // already installed this.originalFetch = window.fetch.bind(window); - const store = this; - window.fetch = function (input: RequestInfo | URL, init?: RequestInit) { + window.fetch = (input: RequestInfo | URL, init?: RequestInit) => { try { const url = input instanceof Request @@ -210,12 +209,12 @@ class WebRTCStore { : String(input); const parsed = new URL(url, window.location.href); if (parsed.origin === window.location.origin) { - return store.tunnelFetch(input, init); + return this.tunnelFetch(input, init); } } catch { // not a parseable URL — fall through } - return store.originalFetch!(input, init); + return this.originalFetch!(input, init); }; }