feat: add savePortalSessions function
This commit is contained in:
parent
98a6b48776
commit
2bc233c6b4
|
@ -121,6 +121,24 @@ export function savePortals() {
|
|||
}
|
||||
}
|
||||
|
||||
export function savePortalSessions() {
|
||||
const portalSessions = {};
|
||||
|
||||
for (const portal of ACTIVE_PORTALS) {
|
||||
const jwt = portal.jwt;
|
||||
if (jwt) {
|
||||
portalSessions[portal[PORTAL_ID]] = jwt;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof globalThis.localStorage !== "undefined") {
|
||||
globalThis.localStorage.setItem(
|
||||
"portal_sessions",
|
||||
JSON.stringify(portalSessions),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function loadSavedPortals(): Portal[] | null {
|
||||
let portals: string | null = null;
|
||||
|
||||
|
|
Loading…
Reference in New Issue