1
0
Fork 0

Added an option to check if the client service is available

master
WolverinDEV 2021-02-19 20:55:14 +01:00
parent 6e2e8b0e51
commit adc942154e
1 changed files with 13 additions and 0 deletions

View File

@ -105,6 +105,19 @@ export class ClientServices {
this.connection.connect(); this.connection.connect();
} }
awaitSession() : Promise<void> {
return new Promise(resolve => {
const unregister = this.events.on("notify_session_initialized", () => {
unregister();
resolve();
});
});
}
isSessionInitialized() {
return this.sessionInitialized;
}
stop() { stop() {
this.connection.disconnect(); this.connection.disconnect();
clearTimeout(this.retryTimer); clearTimeout(this.retryTimer);