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
fix: undefined content type when syncing (fixes streetwriters/notesnook#785)
thecodrr268a0d74a4be
diff --git a/packages/core/__tests__/content.test.js b/packages/core/__tests__/content.test.jsnew file mode 100644index 000000000..ab38a190c--- /dev/null+++ b/packages/core/__tests__/content.test.js@@ -0,0 +1,27 @@+import { groupArray } from "../utils/grouping";+import {+ StorageInterface,+ databaseTest,+ noteTest,+ groupedTest,+ TEST_NOTE,+ TEST_NOTEBOOK,+ IMG_CONTENT,+} from "./utils";++beforeEach(() => {+ StorageInterface.clear();+});++test("adding a deleted content should not throw", () =>+ databaseTest().then(async (db) => {+ await expect(+ db.content.add({+ remote: true,+ deleted: true,+ dateEdited: new Date(),+ id: "hello",+ data: "YOYO!",+ })+ ).resolves.toBeUndefined();+ }));diff --git a/packages/core/content-types/index.js b/packages/core/content-types/index.jsindex 93f263fb3..19c1e94ba 100644--- a/packages/core/content-types/index.js+++ b/packages/core/content-types/index.js@@ -1,6 +1,8 @@import { Tiptap } from "./tiptap";export function getContentFromData(type, data) {+ if (!type) return null;+switch (type) {case "tiptap":return new Tiptap(data);