refactor: remove unnecessary runInAction

This commit is contained in:
Antonella Sgarlatta
2021-05-18 18:20:01 -03:00
parent bff8265df6
commit 91e45b7f7f

View File

@@ -204,10 +204,8 @@ export class NotesState {
if (trashed) { if (trashed) {
const notesDeleted = await this.deleteNotes(false); const notesDeleted = await this.deleteNotes(false);
if (notesDeleted) { if (notesDeleted) {
runInAction(() => { this.unselectNotes();
this.selectedNotes = {}; this.contextMenuOpen = false;
this.contextMenuOpen = false;
});
} }
} else { } else {
await this.changeSelectedNotes((mutator) => { await this.changeSelectedNotes((mutator) => {
@@ -285,10 +283,8 @@ export class NotesState {
mutator.archived = archived; mutator.archived = archived;
}); });
runInAction(() => { this.selectedNotes = {};
this.selectedNotes = {}; this.contextMenuOpen = false;
this.contextMenuOpen = false;
});
} }
async setProtectSelectedNotes(protect: boolean): Promise<void> { async setProtectSelectedNotes(protect: boolean): Promise<void> {