Skip to content

Commit

Permalink
remove timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
fayeed committed Aug 5, 2024
1 parent 78b110b commit e0dfda0
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions connect/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default class Ad4mConnect {
if (data.serviceId) {
this.setPort(data.port);
this.setUrl(data.url);

this.isHosting = true;

setForVersion('ad4mhosting', 'true');
Expand Down Expand Up @@ -297,15 +297,7 @@ export default class Ad4mConnect {
try {
const websocket = new WebSocket(this.url);

websocket.onerror = (error) => {
this.notifyConnectionChange("not_connected");
};

setTimeout(() => {
if (websocket.readyState !== WebSocket.OPEN) {
this.notifyConnectionChange("not_connected");
}
}, 10000);
} catch (e) {
this.notifyConnectionChange("not_connected");
return;
Expand All @@ -315,6 +307,8 @@ export default class Ad4mConnect {
this.requestedRestart = true;
this.wsClient.dispose();
this.apolloClient.stop();
this.wsClient = null;
this.apolloClient = null;
}

this.wsClient = createClient({
Expand Down

0 comments on commit e0dfda0

Please sign in to comment.