Migrate to Tauri V2

This commit is contained in:
kwaroran
2024-10-09 20:07:59 +09:00
parent 0e99d96088
commit 5a931d4ba0
23 changed files with 13225 additions and 1601 deletions

View File

@@ -2,10 +2,9 @@ import { alertConfirm, alertWait } from "./alert";
import { language } from "../lang";
import { Capacitor } from "@capacitor/core";
import {
checkUpdate,
installUpdate,
} from '@tauri-apps/api/updater'
import { relaunch } from '@tauri-apps/api/process'
check,
} from '@tauri-apps/plugin-updater'
import { relaunch } from '@tauri-apps/plugin-process'
export async function checkRisuUpdate(){
@@ -14,12 +13,12 @@ export async function checkRisuUpdate(){
}
try {
const checked = await checkUpdate()
if(checked.shouldUpdate){
const checked = await check()
if(checked){
const conf = await alertConfirm(language.newVersion)
if(conf){
alertWait(`Updating to ${checked.manifest.version}...`)
await installUpdate()
alertWait(`Updating to ${checked.version}...`)
await checked.downloadAndInstall()
await relaunch()
}
}