From b32fbfa7807ea1300ef37189efc51cd9cb572e5e Mon Sep 17 00:00:00 2001 From: akaster99 Date: Wed, 20 Sep 2023 17:01:11 +0900 Subject: [PATCH] fix --- src/ainize.ts | 2 +- src/handlers/handler.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ainize.ts b/src/ainize.ts index fed66ad..7af0614 100644 --- a/src/ainize.ts +++ b/src/ainize.ts @@ -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!'); } diff --git a/src/handlers/handler.ts b/src/handlers/handler.ts index a28b780..e98a366 100644 --- a/src/handlers/handler.ts +++ b/src/handlers/handler.ts @@ -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) {