From e09e59ea5cc6fab05d4297bf94fc978ad3ad1735 Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Fri, 15 Sep 2023 18:28:16 -0400 Subject: [PATCH] closes #161 --- src/stores/GatewayConnectionStore.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/stores/GatewayConnectionStore.ts b/src/stores/GatewayConnectionStore.ts index e81a5786..4201ff13 100644 --- a/src/stores/GatewayConnectionStore.ts +++ b/src/stores/GatewayConnectionStore.ts @@ -68,10 +68,12 @@ export default class GatewayConnectionStore { */ @action async connect(url: string) { - const newUrl = new URL(url); - newUrl.searchParams.append("v", GATEWAY_VERSION); - newUrl.searchParams.append("encoding", GATEWAY_ENCODING); - this.url = newUrl.href; + if (!this.url) { + const newUrl = new URL(url); + newUrl.searchParams.append("v", GATEWAY_VERSION); + newUrl.searchParams.append("encoding", GATEWAY_ENCODING); + this.url = newUrl.href; + } this.logger.debug(`[Connect] ${this.url}`); this.connectionStartTime = Date.now(); this.socket = new WebSocket(this.url);