Skip to content

Commit

Permalink
Attempt clean disconnection before reloading the page
Browse files Browse the repository at this point in the history
  • Loading branch information
lirsacc committed Nov 28, 2023
1 parent 58fdb22 commit 52025e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ export class Session {
}

refresh(): void {
// Attemp clean disconnection first
try {
this.provider.disconnect();
this.provider.destroy();
} catch (err) {
// Page will close so doesn't really matter much
}
resetSession();
}
}

0 comments on commit 52025e2

Please sign in to comment.