[fix] avoid dosync

This commit is contained in:
kwaroran
2023-07-04 06:15:48 +09:00
parent 3f85efccde
commit 1293c285ea
2 changed files with 5 additions and 4 deletions

View File

@@ -97,7 +97,6 @@ export class AccountStorage{
export async function unMigrationAccount() {
const keys = await forageStorage.keys()
let db = get(DataBase)
db.account = null
let i = 0;
const MigrationStorage = localforage.createInstance({name: "risuai"})
@@ -110,6 +109,7 @@ export async function unMigrationAccount() {
i += 1
}
db.account = null
await MigrationStorage.setItem('database/database.bin', encodeRisuSave(db))
alertStore.set({
@@ -117,7 +117,7 @@ export async function unMigrationAccount() {
msg: ""
})
localStorage.removeItem('dosync')
localStorage.setItem('dosync', 'avoid')
localStorage.removeItem('accountst')
localStorage.removeItem('fallbackRisuToken')
location.reload()

View File

@@ -42,9 +42,10 @@ export class AutoStorage{
if(this.isAccount){
return true
}
if(localStorage.getItem('dosync') === 'avoid'){
return false
}
if((localStorage.getItem('dosync') === 'sync' || db.account?.useSync) && (localStorage.getItem('accountst') !== 'able')){
console.log(localStorage.getItem('dosync'))
console.log(db.account)
const keys = await this.realStorage.keys()
let i = 0;
const accountStorage = new AccountStorage()