mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +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) {
|
for (let id of ids) {
|
||||||
if (!this.collection.exists(id)) return;
|
if (!this.collection.exists(id)) return;
|
||||||
if (id.indexOf("note") > -1)
|
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);
|
await this.collection.removeItem(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export default class CachedCollection {
|
|||||||
async removeItem(id) {
|
async removeItem(id) {
|
||||||
if (this.transactionOpen) return;
|
if (this.transactionOpen) return;
|
||||||
if (this.map.delete(id)) {
|
if (this.map.delete(id)) {
|
||||||
this.indexer.remove(id);
|
await this.indexer.remove(id);
|
||||||
await this.indexer.deindex(id);
|
await this.indexer.deindex(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ export default class Storage {
|
|||||||
let data = await this.storage.read(key);
|
let data = await this.storage.read(key);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
clear() {
|
async clear() {
|
||||||
this.storage.clear();
|
await this.storage.clear();
|
||||||
}
|
}
|
||||||
remove(key) {
|
async remove(key) {
|
||||||
this.storage.remove(key);
|
await this.storage.remove(key);
|
||||||
}
|
}
|
||||||
encrypt(password, data) {
|
encrypt(password, data) {
|
||||||
return this.storage.encrypt(password, data);
|
return this.storage.encrypt(password, data);
|
||||||
|
|||||||
Reference in New Issue
Block a user