mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 02:12:10 +08:00
fix(updater): install the already downloaded update instead of fetching it again
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use super::CmdResult;
|
||||
use crate::{cmd::StringifyErr as _, feat, utils::dirs};
|
||||
use crate::{cmd::StringifyErr as _, core::SilentUpdater, feat, utils::dirs};
|
||||
use smartstring::alias::String;
|
||||
use tauri::{AppHandle, Manager as _};
|
||||
|
||||
@@ -44,6 +44,14 @@ pub async fn restart_app() -> CmdResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn install_cached_update(app_handle: AppHandle, version: String) -> CmdResult<bool> {
|
||||
SilentUpdater::global()
|
||||
.install_cached(&app_handle, &version)
|
||||
.await
|
||||
.stringify_err()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_app_dir() -> CmdResult<String> {
|
||||
let app_home_dir = dirs::app_home_dir().stringify_err()?.to_string_lossy().into();
|
||||
|
||||
Reference in New Issue
Block a user