Add deep linking

This commit is contained in:
kwaroran
2024-10-09 21:19:58 +09:00
parent 19d1c1ef7a
commit a66f1664ef
13 changed files with 251 additions and 11 deletions

View File

@@ -16,6 +16,7 @@ import { CharXReader, CharXWriter } from "./process/processzip"
import { Capacitor } from "@capacitor/core"
import { exportModule, readModule, type RisuModule } from "./process/modules"
import { readFile } from "@tauri-apps/plugin-fs"
import { onOpenUrl } from '@tauri-apps/plugin-deep-link';
export const hubURL = "https://sv.risuai.xyz"
@@ -445,6 +446,20 @@ export async function characterURLImport() {
}
}
if(isTauri){
await onOpenUrl((urls) => {
for(const url of urls){
const splited = url.split('/')
const id = splited[splited.length - 1]
const type = splited[splited.length - 2]
switch(type){
case 'realm':{
downloadRisuHub(id)
}
}
}
})
}
}