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(
|
||||
this.application.getAppState().notes.selectedNotes
|
||||
);
|
||||
await Promise.all(
|
||||
selectedNotes.map(
|
||||
async (note) =>
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
mutator.addItemAsRelationship(note);
|
||||
})
|
||||
)
|
||||
);
|
||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||
for (const note of selectedNotes) {
|
||||
mutator.addItemAsRelationship(note);
|
||||
}
|
||||
});
|
||||
this.application.sync();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user