Ensure flags are set before connect/disconnect events (#3846)

This commit is contained in:
Jaco
2021-08-05 16:46:33 +02:00
committed by GitHub
parent 90a84baa52
commit 4ae4e4298c
2 changed files with 4 additions and 4 deletions
+2 -3
View File
@@ -352,8 +352,8 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
}
#onProviderConnect = async (): Promise<void> => {
this.emit('connected');
this._isConnected.next(true);
this.emit('connected');
try {
const [hasMeta, cryptoReady] = await Promise.all([
@@ -382,10 +382,9 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
}
#onProviderDisconnect = (): void => {
this.emit('disconnected');
this._isConnected.next(false);
this._unsubscribeHealth();
this.emit('disconnected');
};
#onProviderError = (error: Error): void => {