mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
core: update core version to 5.8
This commit is contained in:
committed by
Abdullah Atta
parent
0a94ee7c60
commit
f3fa7fe744
@@ -128,14 +128,7 @@ class Merger {
|
|||||||
// it is a locked note, bail out.
|
// it is a locked note, bail out.
|
||||||
if (deserialized.alg && deserialized.cipher) return deserialized;
|
if (deserialized.alg && deserialized.cipher) return deserialized;
|
||||||
|
|
||||||
let type = deserialized.type;
|
return migrateItem(deserialized, version, deserialized.type, this._db);
|
||||||
// temporary fix for streetwriters/notesnook#751
|
|
||||||
if (type === "content") {
|
|
||||||
type = "tiptap";
|
|
||||||
deserialized.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
return migrateItem(deserialized, version, type, this._db);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async _deserialize(item, migrate = true) {
|
async _deserialize(item, migrate = true) {
|
||||||
|
|||||||
@@ -83,4 +83,4 @@ export const EVENTS = {
|
|||||||
systemTimeInvalid: "system:invalidTime"
|
systemTimeInvalid: "system:invalidTime"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CURRENT_DATABASE_VERSION = 5.7;
|
export const CURRENT_DATABASE_VERSION = 5.8;
|
||||||
|
|||||||
@@ -30,16 +30,12 @@ class Migrator {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if item is permanently deleted or just a soft delete
|
||||||
if (item.deleted && !item.type) {
|
if (item.deleted && !item.type) {
|
||||||
await collection.dbCollection?._collection?.addItem(item);
|
await collection.dbCollection?._collection?.addItem(item);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// temporary fix for streetwriters/notesnook#751
|
|
||||||
if (item.type === "content") {
|
|
||||||
item.type = "tiptap";
|
|
||||||
}
|
|
||||||
|
|
||||||
item = await migrateItem(
|
item = await migrateItem(
|
||||||
item,
|
item,
|
||||||
version,
|
version,
|
||||||
|
|||||||
@@ -98,7 +98,22 @@ const migrations = [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ version: 5.7, types: {} }
|
{
|
||||||
|
version: 5.7,
|
||||||
|
types: {
|
||||||
|
tiny: (item) => {
|
||||||
|
if (!item.data || item.data.iv) return item;
|
||||||
|
item.type = "tiptap";
|
||||||
|
return item;
|
||||||
|
},
|
||||||
|
content: (item) => {
|
||||||
|
if (!item.data || item.data.iv) return item;
|
||||||
|
item.type = "tiptap";
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ version: 5.8, types: {} }
|
||||||
];
|
];
|
||||||
|
|
||||||
export async function migrateItem(item, version, type, database) {
|
export async function migrateItem(item, version, type, database) {
|
||||||
|
|||||||
Reference in New Issue
Block a user