mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
core: don't unlink vault notes on vault remove
This commit is contained in:
@@ -160,7 +160,7 @@ export default class Vault {
|
||||
await this.db.notes.remove(...lockedIds);
|
||||
}
|
||||
|
||||
await this.db.vaults.remove(vault.id);
|
||||
await this.db.vaults.remove(vault.id, deleteAllLockedNotes);
|
||||
this.password = undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ export class Vaults implements ICollection {
|
||||
return id;
|
||||
}
|
||||
|
||||
async remove(id: string) {
|
||||
async remove(id: string, unlinkAllNotes = false) {
|
||||
await this.db.transaction(async () => {
|
||||
await this.db.relations.unlinkOfType("vault", [id]);
|
||||
if (unlinkAllNotes) await this.db.relations.unlinkOfType("vault", [id]);
|
||||
await this.collection.softDelete([id]);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user