feat: add image translation feature and enhance regex list functionality

This commit is contained in:
Kwaroran
2024-12-27 15:51:29 +09:00
parent c5f5786af7
commit 191be6d5c1
12 changed files with 376 additions and 69 deletions

View File

@@ -176,9 +176,11 @@ export class AccountStorage{
const db = getDatabase()
this.auth = db?.account?.token
if(!this.auth){
db.account = JSON.parse(localStorage.getItem("fallbackRisuToken"))
this.auth = db?.account?.token
db.account.useSync = true
try {
db.account = JSON.parse(localStorage.getItem("fallbackRisuToken"))
this.auth = db?.account?.token
db.account.useSync = true
} catch (error) {}
}
}

View File

@@ -46,7 +46,7 @@ export class AutoStorage{
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')){
const keys = await this.realStorage.keys()
let i = 0;
const accountStorage = new AccountStorage()