fix(core): update
This commit is contained in:
parent
2a9e58cc35
commit
23cca6cce3
@ -124,6 +124,12 @@ export class Smartsocket {
|
||||
});
|
||||
logger.log('info', 'Socket connected. Trying to authenticate...');
|
||||
this.socketConnections.add(socketConnection);
|
||||
const disconnectSubscription = socketConnection.eventSubject.subscribe((eventArg) => {
|
||||
if (eventArg === 'disconnected') {
|
||||
this.socketConnections.remove(socketConnection);
|
||||
disconnectSubscription.unsubscribe();
|
||||
}
|
||||
})
|
||||
await socketConnection.authenticate();
|
||||
await socketConnection.listenToFunctionRequests();
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ export class SocketConnection {
|
||||
);
|
||||
await this.disconnect();
|
||||
allSocketConnections.remove(this);
|
||||
this.eventSubject.next('disconnected');
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user