Fix tauri dialog API usage

This commit is contained in:
Gregory Schier
2024-10-02 11:45:42 -07:00
parent 4a9e2ac9b6
commit 3b2ee25d75

View File

@@ -3,7 +3,7 @@ use std::time::SystemTime;
use log::info; use log::info;
use tauri::{AppHandle, Manager}; use tauri::{AppHandle, Manager};
use tauri_plugin_dialog::DialogExt; use tauri_plugin_dialog::{DialogExt, MessageDialogButtons};
use tauri_plugin_updater::UpdaterExt; use tauri_plugin_updater::UpdaterExt;
use tokio::task::block_in_place; use tokio::task::block_in_place;
use yaak_plugin_runtime::manager::PluginManager; use yaak_plugin_runtime::manager::PluginManager;
@@ -92,8 +92,10 @@ impl YaakUpdater {
"{} is available. Would you like to download and install it now?", "{} is available. Would you like to download and install it now?",
update.version update.version
)) ))
.ok_button_label("Download") .buttons(MessageDialogButtons::OkCancelCustom(
.cancel_button_label("Later") "Download".to_string(),
"Later".to_string(),
))
.title("Update Available") .title("Update Available")
.show(|confirmed| { .show(|confirmed| {
if !confirmed { if !confirmed {
@@ -105,8 +107,10 @@ impl YaakUpdater {
if h.dialog() if h.dialog()
.message("Would you like to restart the app?") .message("Would you like to restart the app?")
.title("Update Installed") .title("Update Installed")
.ok_button_label("Restart") .buttons(MessageDialogButtons::OkCancelCustom(
.cancel_button_label("Later") "Restart".to_string(),
"Later".to_string(),
))
.blocking_show() .blocking_show()
{ {
h.restart(); h.restart();