Web: Socket: fixed double socket connection

This commit is contained in:
Elyor Djalilov 2024-06-01 11:33:51 +05:00
parent 4de4798cb8
commit a4e7d2b0ca
2 changed files with 6 additions and 14 deletions

View File

@ -874,22 +874,11 @@ class SettingsStore {
this.publicRoomKey = key;
};
socketFilesClient: SocketIOHelper | null = null;
get socketHelper() {
const socketUrl = isPublicRoom() && !this.publicRoomKey ? "" : "/socket.io"; // this.socketUrl;
const socketUrl =
isPublicRoom() && !this.publicRoomKey ? "" : this.socketUrl;
if (!this.socketFilesClient) {
this.socketFilesClient = new SocketIOHelper(
socketUrl,
this.publicRoomKey,
);
// TODO: comment this line
window.socketFilesClient = this.socketFilesClient;
}
return this.socketFilesClient;
return new SocketIOHelper(socketUrl, this.publicRoomKey);
}
getBuildVersionInfo = async () => {

View File

@ -116,6 +116,9 @@ class SocketIOHelper {
console.log("socket connect error", err),
);
this.client.on("disconnect", () => console.log("socket is disconnected"));
// DEV tests
// window.socketHelper = this;
}
get isEnabled() {