mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
optimizations
This commit is contained in:
@@ -13,8 +13,14 @@ export const verifyAuthorization = () =>
|
||||
export const signIn = (request: SignInRequest) =>
|
||||
alovaInstance.Post<SignInResponse>('/rest/signIn', request);
|
||||
|
||||
// Cache storage reference to avoid repeated checks
|
||||
let cachedStorage: Storage | undefined;
|
||||
|
||||
export function getStorage() {
|
||||
return localStorage || sessionStorage;
|
||||
if (!cachedStorage) {
|
||||
cachedStorage = localStorage || sessionStorage;
|
||||
}
|
||||
return cachedStorage;
|
||||
}
|
||||
|
||||
export function storeLoginRedirect(location?: { pathname: string; search: string }) {
|
||||
|
||||
Reference in New Issue
Block a user