From 52025e227bbeb3d69676fa50ab6223709c5d81d9 Mon Sep 17 00:00:00 2001 From: Charles Lirsac Date: Tue, 28 Nov 2023 22:38:58 +0000 Subject: [PATCH] Attempt clean disconnection before reloading the page --- src/session.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/session.ts b/src/session.ts index 11490bf..4428c51 100644 --- a/src/session.ts +++ b/src/session.ts @@ -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(); } }