Show toast after plugin reload

This commit is contained in:
Gregory Schier
2024-09-09 12:36:05 -07:00
parent c0707bb246
commit 36890b9a32
2 changed files with 10 additions and 4 deletions

View File

@@ -60,7 +60,7 @@ use yaak_plugin_runtime::events::{
CallHttpRequestActionRequest, FilterResponse, FindHttpResponsesResponse,
GetHttpRequestActionsResponse, GetHttpRequestByIdResponse, GetTemplateFunctionsResponse,
InternalEvent, InternalEventPayload, PluginBootResponse, RenderHttpRequestResponse,
SendHttpRequestResponse,
SendHttpRequestResponse, ShowToastRequest, ToastVariant,
};
use yaak_plugin_runtime::handle::PluginHandle;
use yaak_templates::{Parser, Tokens};
@@ -2092,7 +2092,7 @@ async fn handle_plugin_event<R: Runtime>(
if plugin.directory != plugin_handle.dir {
continue;
}
upsert_plugin(
&w,
Plugin {
@@ -2104,6 +2104,14 @@ async fn handle_plugin_event<R: Runtime>(
.await
.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
}
InternalEventPayload::SendHttpRequestRequest(req) => {

View File

@@ -17,8 +17,6 @@ export function useActiveWorkspaceChangedToast() {
// Don't notify on the first load
if (id === null) return;
console.log('HELLO?', activeWorkspace?.id, id, window.location);
toast.show({
id: 'workspace-changed',
timeout: 3000,