From fd1823e7ecf46a230fdf2db009a30931692bc320 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 1 Feb 2025 00:55:46 +0100 Subject: make ts linter happy --- web/script/player/sync.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/script/player/sync.ts') diff --git a/web/script/player/sync.ts b/web/script/player/sync.ts index 29a7c80..eabd360 100644 --- a/web/script/player/sync.ts +++ b/web/script/player/sync.ts @@ -82,11 +82,11 @@ export class Playersync { channel_name ??= Math.random().toString(16).padEnd(5, "0").substring(2).substring(0, 6) let [localpart, remotepart, port] = channel_name.split(":") - if (!remotepart?.length) remotepart = window.location.host + if (!remotepart?.length) remotepart = globalThis.location.host if (port) remotepart += ":" + port this.name = localpart + ":" + remotepart - this.ws = new WebSocket(`${window.location.protocol.endsWith("s:") ? "wss" : "ws"}://${remotepart}/playersync/${encodeURIComponent(localpart)}`) + this.ws = new WebSocket(`${globalThis.location.protocol.endsWith("s:") ? "wss" : "ws"}://${remotepart}/playersync/${encodeURIComponent(localpart)}`) this.on_destroy.push(() => this.ws.close()) this.ws.onopen = () => { -- cgit v1.2.3-70-g09d2