core: fix indexes getting replaced on backup restore

This commit is contained in:
Abdullah Atta
2023-09-12 18:27:58 +05:00
committed by Abdullah Atta
parent bd238a6fe4
commit 4c7cd840df

View File

@@ -255,9 +255,9 @@ export default class Backup {
}
for (const collectionKey in toAdd) {
await new Indexer(this._db.storage, collectionKey).writeMulti(
toAdd[collectionKey]
);
const indexer = new Indexer(this._db.storage, collectionKey);
await indexer.init();
await indexer.writeMulti(toAdd[collectionKey]);
}
}