mirror of
https://github.com/zadam/trilium.git
synced 2026-05-07 05:47:26 +02:00
feat(script): increase warning toast time
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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?: Scrip
|
||||
actualEnv: "backend",
|
||||
expectedEnv: "frontend"
|
||||
});
|
||||
ws.sendMessageToAllClients({ type: "toast", message });
|
||||
ws.sendMessageToAllClients({ type: "toast", message, timeout: 10000 });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ export type WebSocketMessage = AllTaskDefinitions | {
|
||||
} | {
|
||||
type: "toast",
|
||||
message: string;
|
||||
timeout?: number;
|
||||
} | {
|
||||
type: "api-log-messages",
|
||||
noteId: string,
|
||||
|
||||
Reference in New Issue
Block a user