mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
feat: remove migrated property
This commit is contained in:
@@ -64,7 +64,7 @@ class Collector {
|
||||
deleted: true,
|
||||
dateModified: Date.now(),
|
||||
});
|
||||
} else if ((isUnsynced && isSyncable) || item.migrated) {
|
||||
} else if (isUnsynced && isSyncable) {
|
||||
prev.push({ ...item, type });
|
||||
}
|
||||
|
||||
@@ -91,8 +91,7 @@ class Collector {
|
||||
async _map(item) {
|
||||
// in case of resolved content
|
||||
delete item.resolved;
|
||||
// turn the migrated flag off so we don't keep syncing this item repeated
|
||||
delete item.migrated;
|
||||
// synced is a local only property
|
||||
delete item.synced;
|
||||
|
||||
return {
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class Content extends Collection {
|
||||
)}</p>`;
|
||||
}
|
||||
|
||||
if (content.remote || content.deleted || content.migrated)
|
||||
if (content.remote || content.deleted)
|
||||
return await this._collection.addItem(
|
||||
await this.extractAttachments(content)
|
||||
);
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class Tags extends Collection {
|
||||
}
|
||||
|
||||
async merge(tag) {
|
||||
if (!tag.migrated) return;
|
||||
if (!tag) return;
|
||||
await this._collection.addItem(tag);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,9 +45,7 @@ export default class Trash {
|
||||
async add(item) {
|
||||
const collection = collectionNameFromItem(item);
|
||||
if (!item || !item.type || !collection) return;
|
||||
// if (item.dateDeleted || item.deleted || item.migrated) {
|
||||
// return await this._collection.addItem(item);
|
||||
// }
|
||||
|
||||
await this.collections[collection]._collection.updateItem({
|
||||
...item,
|
||||
id: item.itemId || item.id,
|
||||
|
||||
@@ -38,7 +38,6 @@ export default class IndexedCollection {
|
||||
}
|
||||
// the item has become local now, so remove the flags
|
||||
delete item.remote;
|
||||
delete item.migrated;
|
||||
|
||||
// if (await this.getEncryptionKey()) {
|
||||
// const encrypted = await this.indexer.encrypt(
|
||||
@@ -47,7 +46,6 @@ export default class IndexedCollection {
|
||||
// );
|
||||
// encrypted.dateModified = item.dateModified;
|
||||
// encrypted.localOnly = item.localOnly;
|
||||
// encrypted.migrated = item.migrated;
|
||||
// encrypted.id = item.id;
|
||||
// await this.indexer.write(item.id, encrypted);
|
||||
// } else
|
||||
|
||||
@@ -17,7 +17,6 @@ class Migrator {
|
||||
}
|
||||
const migrate = migrations[version][item.type || collection.type];
|
||||
if (migrate) item = migrate(item);
|
||||
item.migrated = true;
|
||||
|
||||
if (collection.dbCollection.merge) {
|
||||
await collection.dbCollection.merge(item);
|
||||
|
||||
Reference in New Issue
Block a user