From 2b0e5c41c8d3093fbd383fbe097905771721b704 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Fri, 16 Jan 2026 12:40:42 +0500 Subject: [PATCH] core: remove note content if history item has no content --- packages/core/src/collections/note-history.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/core/src/collections/note-history.ts b/packages/core/src/collections/note-history.ts index 0ebff07c4..18ca7ebb6 100644 --- a/packages/core/src/collections/note-history.ts +++ b/packages/core/src/collections/note-history.ts @@ -206,10 +206,7 @@ export class NoteHistory implements ICollection { title: content.title }); } - } else if ( - (content.data && content.type && !isCipher(content.data)) || - content.title - ) { + } else { const note: Partial< Note & { content: NoteContent; @@ -220,12 +217,13 @@ export class NoteHistory implements ICollection { sessionId: `${Date.now()}` }; - if (content.data && content.type && !isCipher(content.data)) { - note.content = { - data: content.data, - type: content.type - }; - } + note.content = + content.data && content.type && !isCipher(content.data) + ? { + data: content.data, + type: content.type + } + : { data: "

", type: "tiptap" }; if (content.title) { note.title = content.title;