mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 07:24:07 +01:00
Show toast after plugin reload
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user