mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
fix sync
This commit is contained in:
@@ -28,9 +28,11 @@ export default class CachedCollection {
|
||||
if (!item.id) throw new Error("The item must contain the id field.");
|
||||
|
||||
let exists = this.map.has(item.id);
|
||||
await this.updateItem(item);
|
||||
if (!exists) {
|
||||
item.dateCreated = item.dateCreated || Date.now();
|
||||
}
|
||||
await this.updateItem(item);
|
||||
if (!exists) {
|
||||
await this.indexer.index(item.id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user