A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
core: restoring a history session should create a new version
Abdullah Atta80a77871a0a2
diff --git a/packages/core/src/collections/note-history.ts b/packages/core/src/collections/note-history.tsindex 0312b44ad..bb1dc2729 100644--- a/packages/core/src/collections/note-history.ts+++ b/packages/core/src/collections/note-history.ts@@ -129,6 +129,12 @@ export class NoteHistory implements ICollection {return await this.sessionContent.get(session.sessionContentId);}+ async session(sessionId: string) {+ const session = await this.collection.get(sessionId);+ if (!session || isDeleted(session)) return;+ return session;+ }+async remove(sessionId: string) {const session = await this.collection.get(sessionId);if (!session || isDeleted(session)) return;@@ -175,12 +181,15 @@ export class NoteHistory implements ICollection {if (session.locked && isCipher(content.data)) {await this.db.content.add({id: note.contentId,+ noteId: session.noteId,+ sessionId: `${Date.now()}`,data: content.data,type: content.type});} else if (content.data && !isCipher(content.data)) {await this.db.notes.add({id: session.noteId,+ sessionId: `${Date.now()}`,content: {data: content.data,type: content.type