mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-25 02:08:28 +02:00
Show toast after plugin reload
This commit is contained in:
@@ -60,7 +60,7 @@ use yaak_plugin_runtime::events::{
|
|||||||
CallHttpRequestActionRequest, FilterResponse, FindHttpResponsesResponse,
|
CallHttpRequestActionRequest, FilterResponse, FindHttpResponsesResponse,
|
||||||
GetHttpRequestActionsResponse, GetHttpRequestByIdResponse, GetTemplateFunctionsResponse,
|
GetHttpRequestActionsResponse, GetHttpRequestByIdResponse, GetTemplateFunctionsResponse,
|
||||||
InternalEvent, InternalEventPayload, PluginBootResponse, RenderHttpRequestResponse,
|
InternalEvent, InternalEventPayload, PluginBootResponse, RenderHttpRequestResponse,
|
||||||
SendHttpRequestResponse,
|
SendHttpRequestResponse, ShowToastRequest, ToastVariant,
|
||||||
};
|
};
|
||||||
use yaak_plugin_runtime::handle::PluginHandle;
|
use yaak_plugin_runtime::handle::PluginHandle;
|
||||||
use yaak_templates::{Parser, Tokens};
|
use yaak_templates::{Parser, Tokens};
|
||||||
@@ -2092,7 +2092,7 @@ async fn handle_plugin_event<R: Runtime>(
|
|||||||
if plugin.directory != plugin_handle.dir {
|
if plugin.directory != plugin_handle.dir {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
upsert_plugin(
|
upsert_plugin(
|
||||||
&w,
|
&w,
|
||||||
Plugin {
|
Plugin {
|
||||||
@@ -2104,6 +2104,14 @@ async fn handle_plugin_event<R: Runtime>(
|
|||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
let toast_event = plugin_handle.build_event_to_send(
|
||||||
|
&InternalEventPayload::ShowToastRequest(ShowToastRequest {
|
||||||
|
message: "Plugin Reloaded".to_string(),
|
||||||
|
variant: ToastVariant::Info,
|
||||||
|
}),
|
||||||
|
None,
|
||||||
|
);
|
||||||
|
Box::pin(handle_plugin_event(app_handle, &toast_event, plugin_handle)).await;
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
InternalEventPayload::SendHttpRequestRequest(req) => {
|
InternalEventPayload::SendHttpRequestRequest(req) => {
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ export function useActiveWorkspaceChangedToast() {
|
|||||||
// Don't notify on the first load
|
// Don't notify on the first load
|
||||||
if (id === null) return;
|
if (id === null) return;
|
||||||
|
|
||||||
console.log('HELLO?', activeWorkspace?.id, id, window.location);
|
|
||||||
|
|
||||||
toast.show({
|
toast.show({
|
||||||
id: 'workspace-changed',
|
id: 'workspace-changed',
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
|
|||||||
Reference in New Issue
Block a user