[fix] avoid dosync
This commit is contained in:
@@ -97,7 +97,6 @@ export class AccountStorage{
|
|||||||
export async function unMigrationAccount() {
|
export async function unMigrationAccount() {
|
||||||
const keys = await forageStorage.keys()
|
const keys = await forageStorage.keys()
|
||||||
let db = get(DataBase)
|
let db = get(DataBase)
|
||||||
db.account = null
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
const MigrationStorage = localforage.createInstance({name: "risuai"})
|
const MigrationStorage = localforage.createInstance({name: "risuai"})
|
||||||
|
|
||||||
@@ -110,6 +109,7 @@ export async function unMigrationAccount() {
|
|||||||
i += 1
|
i += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
db.account = null
|
||||||
await MigrationStorage.setItem('database/database.bin', encodeRisuSave(db))
|
await MigrationStorage.setItem('database/database.bin', encodeRisuSave(db))
|
||||||
|
|
||||||
alertStore.set({
|
alertStore.set({
|
||||||
@@ -117,7 +117,7 @@ export async function unMigrationAccount() {
|
|||||||
msg: ""
|
msg: ""
|
||||||
})
|
})
|
||||||
|
|
||||||
localStorage.removeItem('dosync')
|
localStorage.setItem('dosync', 'avoid')
|
||||||
localStorage.removeItem('accountst')
|
localStorage.removeItem('accountst')
|
||||||
localStorage.removeItem('fallbackRisuToken')
|
localStorage.removeItem('fallbackRisuToken')
|
||||||
location.reload()
|
location.reload()
|
||||||
|
|||||||
@@ -42,9 +42,10 @@ export class AutoStorage{
|
|||||||
if(this.isAccount){
|
if(this.isAccount){
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if(localStorage.getItem('dosync') === 'avoid'){
|
||||||
|
return false
|
||||||
|
}
|
||||||
if((localStorage.getItem('dosync') === 'sync' || db.account?.useSync) && (localStorage.getItem('accountst') !== 'able')){
|
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()
|
const keys = await this.realStorage.keys()
|
||||||
let i = 0;
|
let i = 0;
|
||||||
const accountStorage = new AccountStorage()
|
const accountStorage = new AccountStorage()
|
||||||
|
|||||||
Reference in New Issue
Block a user