refactor: add tag method

Co-authored-by: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com>
This commit is contained in:
Antonella Sgarlatta
2021-05-07 19:12:35 -03:00
committed by GitHub
parent 461f3ccfa4
commit 3906b9a9b4

View File

@@ -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();
} }