mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +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.
|
||||
if (deserialized.alg && deserialized.cipher) return deserialized;
|
||||
|
||||
let type = deserialized.type;
|
||||
// temporary fix for streetwriters/notesnook#751
|
||||
if (type === "content") {
|
||||
type = "tiptap";
|
||||
deserialized.type = type;
|
||||
}
|
||||
|
||||
return migrateItem(deserialized, version, type, this._db);
|
||||
return migrateItem(deserialized, version, deserialized.type, this._db);
|
||||
}
|
||||
|
||||
async _deserialize(item, migrate = true) {
|
||||
|
||||
@@ -83,4 +83,4 @@ export const EVENTS = {
|
||||
systemTimeInvalid: "system:invalidTime"
|
||||
};
|
||||
|
||||
export const CURRENT_DATABASE_VERSION = 5.7;
|
||||
export const CURRENT_DATABASE_VERSION = 5.8;
|
||||
|
||||
@@ -30,16 +30,12 @@ class Migrator {
|
||||
continue;
|
||||
}
|
||||
|
||||
// check if item is permanently deleted or just a soft delete
|
||||
if (item.deleted && !item.type) {
|
||||
await collection.dbCollection?._collection?.addItem(item);
|
||||
continue;
|
||||
}
|
||||
|
||||
// temporary fix for streetwriters/notesnook#751
|
||||
if (item.type === "content") {
|
||||
item.type = "tiptap";
|
||||
}
|
||||
|
||||
item = await migrateItem(
|
||||
item,
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user