diff --git a/apps/client/src/widgets/dialogs/confirm.tsx b/apps/client/src/widgets/dialogs/confirm.tsx
index 8ccfcd6c2..79829d4d4 100644
--- a/apps/client/src/widgets/dialogs/confirm.tsx
+++ b/apps/client/src/widgets/dialogs/confirm.tsx
@@ -4,11 +4,12 @@ import { t } from "../../services/i18n";
import { useState } from "preact/hooks";
import FormCheckbox from "../react/FormCheckbox";
import { useTriliumEvent } from "../react/hooks";
-import type { VNode } from "preact";
+import { isValidElement, type VNode } from "preact";
+import { RawHtmlBlock } from "../react/RawHtml";
interface ConfirmDialogProps {
title?: string;
- message?: string | HTMLElement;
+ message?: MessageType;
callback?: ConfirmDialogCallback;
isConfirmDeleteNoteBox?: boolean;
}
@@ -21,7 +22,7 @@ export default function ConfirmDialog() {
function showDialog(title: string | null, message: MessageType, callback: ConfirmDialogCallback, isConfirmDeleteNoteBox: boolean) {
setOpts({
title: title ?? undefined,
- message: (typeof message === "object" && "length" in message ? message[0] : message),
+ message,
callback,
isConfirmDeleteNoteBox
});
@@ -58,9 +59,10 @@ export default function ConfirmDialog() {
show={shown}
stackable
>
- {!opts?.message || typeof opts?.message === "string"
- ?
{(opts?.message as string) ?? ""}
- : }
+ {isValidElement(opts?.message)
+ ? opts?.message
+ :
+ }
{opts?.isConfirmDeleteNoteBox && (
{isValidElement(opts?.message)
? opts?.message
- :
+ :
}
);
}
diff --git a/apps/client/src/widgets/type_widgets/code/Code.tsx b/apps/client/src/widgets/type_widgets/code/Code.tsx
index 02117f19f..b6cde1c7e 100644
--- a/apps/client/src/widgets/type_widgets/code/Code.tsx
+++ b/apps/client/src/widgets/type_widgets/code/Code.tsx
@@ -77,7 +77,7 @@ export function EditableCode({ note, ntxId, noteContext, debounceUpdate, parentC
const spacedUpdate = useEditorSpacedUpdate({
note,
noteContext,
- getData: () => ({ content: editorRef.current?.getText() }),
+ getData: () => ({ content: editorRef.current?.getText() ?? "" }),
onContentChange: (content) => {
const codeEditor = editorRef.current;
if (!codeEditor) return;
diff --git a/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx b/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx
index ac00194e3..bf587b949 100644
--- a/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx
+++ b/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx
@@ -25,7 +25,7 @@ interface CKEditorWithWatchdogProps extends Pick, "cla
watchdogRef: RefObject;
watchdogConfig?: WatchdogConfig;
onNotificationWarning?: (evt: any, data: any) => void;
- onWatchdogStateChange?: (watchdog: EditorWatchdog) => void;
+ onWatchdogStateChange?: (watchdog: EditorWatchdog) => void;
onChange: () => void;
/** Called upon whenever a new CKEditor instance is initialized, whether it's the first initialization, after a crash or after a config change that requires it (e.g. content language). */
onEditorInitialized?: (editor: CKTextEditor) => void;
@@ -204,7 +204,7 @@ export default function CKEditorWithWatchdog({ containerRef: externalContainerRe
);
}
-function buildWatchdog(isClassicEditor: boolean, watchdogConfig?: WatchdogConfig): EditorWatchdog {
+function buildWatchdog(isClassicEditor: boolean, watchdogConfig?: WatchdogConfig): EditorWatchdog {
if (isClassicEditor) {
return new EditorWatchdog(ClassicEditor, watchdogConfig);
} else {