[feat] android support
This commit is contained in:
@@ -8,11 +8,13 @@ import { DataBase, type Database } from "./database"
|
||||
import { AccountStorage } from "./accountStorage"
|
||||
import { decodeRisuSave, encodeRisuSave } from "./risuSave";
|
||||
import { language } from "src/lang"
|
||||
import { MobileStorage } from "./mobileStorage"
|
||||
import { Capacitor } from "@capacitor/core"
|
||||
|
||||
export class AutoStorage{
|
||||
isAccount:boolean = false
|
||||
|
||||
realStorage:LocalForage|NodeStorage|OpfsStorage|AccountStorage
|
||||
realStorage:LocalForage|NodeStorage|OpfsStorage|AccountStorage|MobileStorage
|
||||
|
||||
async setItem(key:string, value:Uint8Array):Promise<string|null> {
|
||||
await this.Init()
|
||||
@@ -116,6 +118,10 @@ export class AutoStorage{
|
||||
this.isAccount = true
|
||||
return
|
||||
}
|
||||
if(Capacitor.isNativePlatform()){
|
||||
this.realStorage = new MobileStorage()
|
||||
return
|
||||
}
|
||||
if(isNodeServer){
|
||||
console.log("using node storage")
|
||||
this.realStorage = new NodeStorage()
|
||||
|
||||
Reference in New Issue
Block a user