mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 06:49:50 +02:00
Fix plugin installation from directory
This commit is contained in:
@@ -1276,12 +1276,16 @@ async fn cmd_install_plugin<R: Runtime>(
|
|||||||
app_handle: AppHandle<R>,
|
app_handle: AppHandle<R>,
|
||||||
window: WebviewWindow<R>,
|
window: WebviewWindow<R>,
|
||||||
) -> YaakResult<Plugin> {
|
) -> YaakResult<Plugin> {
|
||||||
plugin_manager.add_plugin_by_dir(&PluginContext::new(&window), &directory, true).await?;
|
let plugin = app_handle.db().upsert_plugin(
|
||||||
|
&Plugin { directory: directory.into(), url, enabled: true, ..Default::default() },
|
||||||
Ok(app_handle.db().upsert_plugin(
|
|
||||||
&Plugin { directory: directory.into(), url, ..Default::default() },
|
|
||||||
&UpdateSource::from_window(&window),
|
&UpdateSource::from_window(&window),
|
||||||
)?)
|
)?;
|
||||||
|
|
||||||
|
plugin_manager
|
||||||
|
.add_plugin_by_dir(&PluginContext::new(&window), &plugin.directory, plugin.enabled)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(plugin)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
|||||||
Reference in New Issue
Block a user