From 440c12ac024e84f166eaa4115ef6715c39de2eea Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 25 Nov 2024 20:59:54 +0100 Subject: replace window usage with globalThis --- client-web/source/protocol/mod.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client-web/source/protocol/mod.ts') diff --git a/client-web/source/protocol/mod.ts b/client-web/source/protocol/mod.ts index d554820..de4293d 100644 --- a/client-web/source/protocol/mod.ts +++ b/client-web/source/protocol/mod.ts @@ -21,7 +21,7 @@ export class SignalingConnection { constructor() { } async connect(): Promise { log("ws", "connecting…") - const ws_url = new URL(`${window.location.protocol.endsWith("s:") ? "wss" : "ws"}://${window.location.host}/signaling`) + const ws_url = new URL(`${globalThis.location.protocol.endsWith("s:") ? "wss" : "ws"}://${globalThis.location.host}/signaling`) this.websocket = new WebSocket(ws_url) this.websocket.onerror = () => this.on_error() this.websocket.onclose = () => this.on_close() @@ -38,7 +38,7 @@ export class SignalingConnection { on_close() { log("ws", "websocket closed"); setTimeout(() => { - window.location.reload() + globalThis.location.reload() }, 1000) } on_open() { -- cgit v1.2.3-70-g09d2