Skip to content

Commit

Permalink
fix: check address
Browse files Browse the repository at this point in the history
  • Loading branch information
yoojinko committed Feb 14, 2024
1 parent 3889c22 commit 57f02ae
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/handlers/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,18 @@ export default class Handler {
async disconnect() {
this.checkEventManager();
await this.ain.getEventManager().disconnect();
console.log('disconnected');
console.log('Disconnected');
}

private async disconnectedCb() {
if(await AinModule.getInstance().getAddress()) {
console.log('disconnected. reconnecting...');
await this.connect();
try {
const address = await AinModule.getInstance().getAddress();
if (address) {
console.log('Disconnected. Reconnecting...');
await this.connect();
}
} catch (_) {
return;
}
}

Expand Down

0 comments on commit 57f02ae

Please sign in to comment.