fix: content type being set to "content" during sync

this bug broke export/publishing & basically
everything that depends on content type
to function.
This commit is contained in:
thecodrr
2022-08-06 10:45:15 +05:00
parent 62b715645f
commit cf9bad7db8
4 changed files with 15 additions and 8 deletions

View File

@@ -107,7 +107,11 @@ class Merger {
if (deserialized.alg && deserialized.cipher) return deserialized;
let type = deserialized.type;
if (!type && deserialized.data) type = "tiptap";
// temporary fix for streetwriters/notesnook#751
if (type === "content") {
type = "tiptap";
deserialized.type = type;
}
if (!migrations[version]) {
throw new Error(
@@ -119,7 +123,6 @@ class Merger {
const migrate = migrations[version][type];
if (migrate) {
console.log(migrate, version, type);
return migrate(deserialized);
}
return deserialized;