feat: add module apply

This commit is contained in:
kwaroran
2024-06-05 16:38:44 +09:00
parent 1b776c3076
commit 764c2370dd
11 changed files with 115 additions and 35 deletions

View File

@@ -6,7 +6,7 @@ import { Capacitor } from "@capacitor/core"
import { DataBase, type MessageGenerationInfo } from "./storage/database"
interface alertData{
type: 'error'| 'normal'|'none'|'ask'|'wait'|'selectChar'|'input'|'toast'|'wait2'|'markdown'|'select'|'login'|'tos'|'cardexport'|'requestdata'|'addchar'|'hypaV2',
type: 'error'| 'normal'|'none'|'ask'|'wait'|'selectChar'|'input'|'toast'|'wait2'|'markdown'|'select'|'login'|'tos'|'cardexport'|'requestdata'|'addchar'|'hypaV2'|'selectModule',
msg: string,
submsg?: string
}
@@ -269,6 +269,23 @@ export async function alertInput(msg:string){
return get(alertStore).msg
}
export async function alertModuleSelect(){
alertStore.set({
'type': 'selectModule',
'msg': ''
})
while(true){
if (get(alertStore).type === 'none'){
break
}
await sleep(10)
}
return get(alertStore).msg
}
export function alertRequestData(info:AlertGenerationInfoStoreData){
alertGenerationInfoStore.set(info)
alertStore.set({