[fix] load caching fix
This commit is contained in:
@@ -45,7 +45,7 @@ export class AccountStorage{
|
|||||||
}
|
}
|
||||||
let da:Response
|
let da:Response
|
||||||
while((!da) || da.status === 403){
|
while((!da) || da.status === 403){
|
||||||
da = await fetch(hubURL + '/api/account/read', {
|
da = await fetch(hubURL + '/api/account/read/' + Buffer.from(key ,'utf-8').toString('base64url'), {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
'x-risu-key': key,
|
'x-risu-key': key,
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ export class AutoStorage{
|
|||||||
}
|
}
|
||||||
if((localStorage.getItem('dosync') === 'sync' || db.account?.useSync) && (localStorage.getItem('accountst') !== 'able')){
|
if((localStorage.getItem('dosync') === 'sync' || db.account?.useSync) && (localStorage.getItem('accountst') !== 'able')){
|
||||||
getUnpargeables(db)
|
getUnpargeables(db)
|
||||||
console.log("migrating")
|
|
||||||
const keys = await this.realStorage.keys()
|
const keys = await this.realStorage.keys()
|
||||||
let i = 0;
|
let i = 0;
|
||||||
const accountStorage = new AccountStorage()
|
const accountStorage = new AccountStorage()
|
||||||
@@ -90,9 +89,11 @@ export class AutoStorage{
|
|||||||
localStorage.setItem('accountst', 'able')
|
localStorage.setItem('accountst', 'able')
|
||||||
localStorage.setItem('fallbackRisuToken',JSON.stringify(db.account))
|
localStorage.setItem('fallbackRisuToken',JSON.stringify(db.account))
|
||||||
this.isAccount = true
|
this.isAccount = true
|
||||||
|
await localforage.clear()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
else if(localStorage.getItem('accountst') === 'able'){
|
else if(localStorage.getItem('accountst') === 'able'){
|
||||||
|
localStorage.setItem('accountst', 'able')
|
||||||
this.realStorage = new AccountStorage()
|
this.realStorage = new AccountStorage()
|
||||||
this.isAccount = true
|
this.isAccount = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user