mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
core: remove note's vault relation regardless of vault
This commit is contained in:
@@ -180,9 +180,8 @@ export default class Vault {
|
||||
async remove(noteId: string, password: string) {
|
||||
await this.unlockNote(noteId, password, true);
|
||||
|
||||
const vault = await this.db.vaults.default();
|
||||
if (!vault) await this.create(password);
|
||||
else await this.db.relations.unlink(vault, { id: noteId, type: "note" });
|
||||
if (!(await this.exists())) await this.create(password);
|
||||
await this.db.relations.to({ id: noteId, type: "note" }, "vault").unlink();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user