feat: hoppscotch agent and agent interceptor (#4396)

Co-authored-by: CuriousCorrelation <CuriousCorrelation@gmail.com>
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
Andrew Bastin
2024-10-03 20:26:30 +05:30
committed by GitHub
parent 0f27cf2d49
commit f75900ed30
106 changed files with 14636 additions and 609 deletions

View File

@@ -0,0 +1,34 @@
#[cfg(desktop)]
pub async fn check_and_install_updates(app: tauri::AppHandle, updater: tauri_plugin_updater::Updater) {
use tauri::Manager;
use tauri_plugin_dialog::MessageDialogKind;
use tauri_plugin_dialog::DialogExt;
let update = updater.check().await;
if let Ok(Some(update)) = update {
let do_update = app.dialog()
.message(
format!(
"Update to {} is available!{}",
update.version,
update.body
.clone()
.map(|body| format!("\n\nRelease Notes: {}", body))
.unwrap_or("".into())
)
)
.title("Update Available")
.kind(MessageDialogKind::Info)
.ok_button_label("Update")
.cancel_button_label("Cancel")
.blocking_show();
if do_update {
let _ = update.download_and_install(|_, _| {}, || {}).await;
tauri::process::restart(&app.env());
}
}
}