mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-05 06:16:23 +01:00
Fix plugin installation from directory
This commit is contained in:
1 parent
d544899f39
commit
4d2bf9304a
1 file changed
+9
-5
@@ -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