Skip to content

Commit

Permalink
closes #161
Browse files Browse the repository at this point in the history
  • Loading branch information
Puyodead1 committed Sep 15, 2023
1 parent 4a1618d commit e09e59e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/stores/GatewayConnectionStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e09e59e

Please sign in to comment.