Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(script): increase warning toast time
Elian Doranafd2806a6788
diff --git a/apps/client/src/services/ws.ts b/apps/client/src/services/ws.tsindex 47ed90341b..b8c606d43b 100644--- a/apps/client/src/services/ws.ts+++ b/apps/client/src/services/ws.ts@@ -134,7 +134,7 @@ async function handleMessage(event: MessageEvent<any>) {} else if (message.type === "api-log-messages") {appContext.triggerEvent("apiLogMessages", { noteId: message.noteId, messages: message.messages });} else if (message.type === "toast") {- toast.showMessage(message.message);+ toast.showMessage(message.message, message.timeout);} else if (message.type === "execute-script") {const originEntity = message.originEntityId ? await froca.getNote(message.originEntityId) : null;diff --git a/apps/server/src/services/script.ts b/apps/server/src/services/script.tsindex b914631e71..8f971f2d4f 100644--- a/apps/server/src/services/script.ts+++ b/apps/server/src/services/script.ts@@ -33,7 +33,7 @@ function executeNote(note: BNote, apiParams: ApiParams) {actualEnv: "frontend",expectedEnv: "backend"});- ws.sendMessageToAllClients({ type: "toast", message });+ ws.sendMessageToAllClients({ type: "toast", message, timeout: 10000 });}return;@@ -143,7 +143,7 @@ function getScriptBundleForFrontend(note: BNote, script?: string, params?: ScripactualEnv: "backend",expectedEnv: "frontend"});- ws.sendMessageToAllClients({ type: "toast", message });+ ws.sendMessageToAllClients({ type: "toast", message, timeout: 10000 });return;}diff --git a/packages/commons/src/lib/ws_api.ts b/packages/commons/src/lib/ws_api.tsindex d0641e98d1..cbc997861c 100644--- a/packages/commons/src/lib/ws_api.ts+++ b/packages/commons/src/lib/ws_api.ts@@ -120,6 +120,7 @@ export type WebSocketMessage = AllTaskDefinitions | {} | {type: "toast",message: string;+ timeout?: number;} | {type: "api-log-messages",noteId: string,