Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: set session content before saving

Abdullah Atta32998b9c8c4b
diff --git a/apps/web/src/components/editor/index.tsx b/apps/web/src/components/editor/index.tsx
index 6a2db1b6e..cb46ea46f 100644
--- a/apps/web/src/components/editor/index.tsx
+++ b/apps/web/src/components/editor/index.tsx
@@ -247,6 +247,10 @@ function EditorView({
onPreviewDocument={(url) => setDocPreview(url)}
onContentChange={() => (lastChangedTime.current = Date.now())}
onSave={(content, ignoreEdit) => {
+ const data = content();
+ if (!session.content)
+ session.content = { type: "tiptap", data };
+ else session.content.data = data;
deferredSave(session.id, session.id, ignoreEdit, data);
}}
options={{