Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: do not send & wait for session expired event

thecodrr2632a06e8e70
diff --git a/packages/core/api/token-manager.js b/packages/core/api/token-manager.js
index 7c4d10a84..f02f15f19 100644
--- a/packages/core/api/token-manager.js
+++ b/packages/core/api/token-manager.js
@@ -49,7 +49,7 @@ class TokenManager {
return await this.getAccessToken(true);
}
RETRIES = 0;
- if (await sendSessionExpiredEvent()) return await this.getAccessToken();
+ EV.publish(EVENTS.userSessionExpired);
}
return null;
}
diff --git a/packages/core/common.js b/packages/core/common.js
index 968ddc92e..6ad55576d 100644
--- a/packages/core/common.js
+++ b/packages/core/common.js
@@ -8,12 +8,6 @@ export async function sendCheckUserStatusEvent(type) {
return results.some((r) => r.type === type && r.result === true);
}
-export async function sendSessionExpiredEvent() {
- const results = await EV.publishWithResult(EVENTS.userSessionExpired);
- if (typeof results === "boolean") return results;
- return results.some((r) => r.result === true);
-}
-
export const CHECK_IDS = {
noteColor: "note:color",
noteTag: "note:tag",