Fixed bugs in Plugin settings pane

This commit is contained in:
Gregory Schier
2025-07-20 08:28:00 -07:00
parent 861b41b5ae
commit 86f23990eb
7 changed files with 146 additions and 105 deletions

View File

@@ -13,7 +13,10 @@ use yaak_models::models::Plugin;
use yaak_models::query_manager::QueryManagerExt;
use yaak_models::util::UpdateSource;
pub async fn delete_and_uninstall<R: Runtime>(window: &WebviewWindow<R>, plugin_id: &str) -> Result<Plugin> {
pub async fn delete_and_uninstall<R: Runtime>(
window: &WebviewWindow<R>,
plugin_id: &str,
) -> Result<Plugin> {
let plugin_manager = window.state::<PluginManager>();
let plugin = window.db().delete_plugin_by_id(plugin_id, &UpdateSource::from_window(&window))?;
plugin_manager.uninstall(&PluginWindowContext::new(&window), plugin.directory.as_str()).await?;
@@ -25,6 +28,7 @@ pub async fn download_and_install<R: Runtime>(
name: &str,
version: Option<String>,
) -> Result<PluginVersion> {
info!("Installing plugin {} {}", name, version.clone().unwrap_or_default());
let plugin_manager = window.state::<PluginManager>();
let plugin_version = get_plugin(window.app_handle(), name, version).await?;
let resp = download_plugin_archive(window.app_handle(), &plugin_version).await?;