mirror of
https://github.com/standardnotes/app.git
synced 2026-01-16 23:01:30 +00:00
fix: remove recursive tag deletion
This commit is contained in:
parent
a85d2b9676
commit
124f7779c3
2 changed files with 8 additions and 20 deletions
|
|
@ -198,15 +198,9 @@ export class NoteTagsState {
|
|||
async removeTagFromActiveNote(tag: SNTag): Promise<void> {
|
||||
const { activeNote } = this;
|
||||
if (activeNote) {
|
||||
const descendantTags = this.application.getTagDescendants(tag);
|
||||
const tagsToRemove = [...descendantTags, tag];
|
||||
await Promise.all(
|
||||
tagsToRemove.map(async (tag) => {
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
mutator.removeItemAsRelationship(activeNote);
|
||||
});
|
||||
})
|
||||
);
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
mutator.removeItemAsRelationship(activeNote);
|
||||
});
|
||||
this.application.sync();
|
||||
this.reloadTags();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -346,17 +346,11 @@ export class NotesState {
|
|||
|
||||
async removeTagFromSelectedNotes(tag: SNTag): Promise<void> {
|
||||
const selectedNotes = Object.values(this.selectedNotes);
|
||||
const descendantTags = this.application.getTagDescendants(tag);
|
||||
const tagsToRemove = [...descendantTags, tag];
|
||||
await Promise.all(
|
||||
tagsToRemove.map(async (tag) => {
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
for (const note of selectedNotes) {
|
||||
mutator.removeItemAsRelationship(note);
|
||||
}
|
||||
});
|
||||
})
|
||||
);
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
for (const note of selectedNotes) {
|
||||
mutator.removeItemAsRelationship(note);
|
||||
}
|
||||
});
|
||||
this.application.sync();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue