mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
fix: remove/clear is not async
This commit is contained in:
@@ -35,7 +35,7 @@ export default class Trash {
|
||||
for (let id of ids) {
|
||||
if (!this.collection.exists(id)) return;
|
||||
if (id.indexOf("note") > -1)
|
||||
this.deltaStorage.remove(id.replace("_deleted", "") + "_delta");
|
||||
await this.deltaStorage.remove(id.replace("_deleted", "") + "_delta");
|
||||
await this.collection.removeItem(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ export default class CachedCollection {
|
||||
async removeItem(id) {
|
||||
if (this.transactionOpen) return;
|
||||
if (this.map.delete(id)) {
|
||||
this.indexer.remove(id);
|
||||
await this.indexer.remove(id);
|
||||
await this.indexer.deindex(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ export default class Storage {
|
||||
let data = await this.storage.read(key);
|
||||
return data;
|
||||
}
|
||||
clear() {
|
||||
this.storage.clear();
|
||||
async clear() {
|
||||
await this.storage.clear();
|
||||
}
|
||||
remove(key) {
|
||||
this.storage.remove(key);
|
||||
async remove(key) {
|
||||
await this.storage.remove(key);
|
||||
}
|
||||
encrypt(password, data) {
|
||||
return this.storage.encrypt(password, data);
|
||||
|
||||
Reference in New Issue
Block a user