refactor: add tag method
Co-authored-by: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
461f3ccfa4
commit
3906b9a9b4
@@ -38,14 +38,11 @@ export class TagsState {
|
|||||||
const selectedNotes = Object.values(
|
const selectedNotes = Object.values(
|
||||||
this.application.getAppState().notes.selectedNotes
|
this.application.getAppState().notes.selectedNotes
|
||||||
);
|
);
|
||||||
await Promise.all(
|
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||||
selectedNotes.map(
|
for (const note of selectedNotes) {
|
||||||
async (note) =>
|
mutator.addItemAsRelationship(note);
|
||||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
}
|
||||||
mutator.addItemAsRelationship(note);
|
});
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
this.application.sync();
|
this.application.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user