feat(client/bundle): add button to open script note

This commit is contained in:
Elian Doran 2025-12-20 22:51:04 +02:00
parent 1e94125133
commit c558255450
No known key found for this signature in database
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,8 @@
import { signal } from "@preact/signals";
import appContext from "../components/app_context.js";
import froca from "./froca.js";
import { t } from "./i18n.js";
import utils from "./utils.js";
export interface ToastOptions {
@ -69,7 +71,13 @@ export async function showErrorForScriptNote(noteId: string, message: string) {
title: note?.title ?? "",
icon: note?.getIcon() ?? "bx bx-error-circle",
message,
timeout: 15_000
timeout: 15_000,
buttons: [
{
text: t("toast.open-script-note"),
onClick: () => appContext.tabManager.openInNewTab(noteId, null, true)
}
]
});
}

View File

@ -29,7 +29,8 @@
"widget-render-error": {
"title": "Failed to render a custom React widget"
},
"widget-missing-parent": "Custom widget does not have mandatory 'parentWidget' property defined."
"widget-missing-parent": "Custom widget does not have mandatory 'parentWidget' property defined.",
"open-script-note": "Open script note"
},
"add_link": {
"add_link": "Add link",