mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-22 05:34:04 +02:00
back to normal setup methods
This commit is contained in:
parent
69686f7514
commit
75583ac6ce
6 changed files with 56 additions and 106 deletions
|
@ -1,16 +1,8 @@
|
|||
use tauri::plugin::TauriPlugin;
|
||||
use tauri::AppHandle;
|
||||
use tauri::{AppHandle, async_runtime};
|
||||
use tauri_plugin_dialog::{DialogExt, MessageDialogKind};
|
||||
use tauri_plugin_updater::UpdaterExt;
|
||||
use tokio;
|
||||
|
||||
pub fn init() -> TauriPlugin<tauri::Wry> {
|
||||
tauri::plugin::Builder::new("updater")
|
||||
.invoke_handler(tauri::generate_handler![check_for_updates])
|
||||
.build()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn check_for_updates(app: AppHandle) {
|
||||
println!("Checking for updates...");
|
||||
|
||||
|
@ -36,7 +28,7 @@ pub async fn check_for_updates(app: AppHandle) {
|
|||
if !response {
|
||||
return;
|
||||
}
|
||||
tokio::spawn(async move {
|
||||
async_runtime::spawn(async move {
|
||||
if let Err(e) = update.download_and_install(|_, _| {}, || {}).await {
|
||||
println!("Error installing new update: {:?}", e);
|
||||
app.dialog().message(
|
||||
|
@ -51,4 +43,4 @@ pub async fn check_for_updates(app: AppHandle) {
|
|||
println!("Failed to check for updates: {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue