Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
akastercomcom committed Sep 20, 2023
1 parent e547d6c commit b32fbfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ainize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export default class Ainize {
}

async logout() {
await this.handler.disconnect();
this.ain.removeDefaultAccount();
await this.handler.disconnect();
console.log('logout success!');
}

Expand Down
6 changes: 4 additions & 2 deletions src/handlers/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ export default class Handler {
}

private async disconnectedCb() {
console.log('disconnected. reconnecting...');
await this.connect();
if(!AinModule.getInstance().isDefaultAccountExist()) {
console.log('disconnected. reconnecting...');
await this.connect();
}
}

async subscribe(requester:string, recordId:string, appName: string, resolve: any) {
Expand Down

0 comments on commit b32fbfa

Please sign in to comment.