change local storage to session storage in api

This commit is contained in:
b1ek 2023-05-17 02:49:34 +10:00
parent 7d0616add7
commit c618c361b8
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 4 additions and 4 deletions

View File

@ -40,15 +40,15 @@ class IAPIObject {
/** @returns {ThisType} */
static restoreFromLocalStorage() {
_checkStorageSupport();
if (!window.localStorage.getItem(this.storage_key))
if (!window.sessionStorage.getItem(this.storage_key))
return false;
return new APIToken(window.localStorage.getItem(this.storage_key));
return new APIToken(window.sessionStorage.getItem(this.storage_key));
}
/** @returns {boolean} */
static isCached() {
this._checkStorageSupport();
if (window.localStorage.getItem(this.storage_key)) {
if (window.sessionStorage.getItem(this.storage_key)) {
return true;
}
return false;
@ -62,7 +62,7 @@ class IAPIObject {
saveToLocalStorage() {
this._IcheckStorageSupport();
window.localStorage.setItem(this._getStorageKey(), JSON.stringify(this));
window.sessionStorage.setItem(this._getStorageKey(), JSON.stringify(this));
}
}