refactor: Add importPreset function to handle importing presets in characterCards.ts

This commit is contained in:
kwaroran
2024-05-30 13:12:49 +09:00
parent 170e673a19
commit c4651408a6
2 changed files with 38 additions and 4 deletions

View File

@@ -1301,8 +1301,13 @@ export async function downloadPreset(id:number, type:'json'|'risupreset'|'return
}
export async function importPreset(){
const f = await selectSingleFile(["json", "preset", "risupreset"])
export async function importPreset(f:{
name:string
data:Uint8Array
}|null = null){
if(!f){
f = await selectSingleFile(["json", "preset", "risupreset"])
}
if(!f){
return
}