Skip to content

Commit

Permalink
Don't wait for sort event after complete:all on annotation deep link
Browse files Browse the repository at this point in the history
This was preventing focus on annotation deep link.
  • Loading branch information
jgonggrijp committed Jan 6, 2022
1 parent 43807db commit 59d5713
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions frontend/src/explorer/explorer-event-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,10 @@ class ExplorerEventController {
// Focus might not work if the collection isn't complete yet. In that
// case, re-focus when it is complete. This will cause
// `openSourceAnnotation` to run again.
if (!collection.get(model)) collection.once(
'complete:all', () => collection.once('sort', () => {
model = collection.get(model);
model.trigger('focus', model);
})
);
if (!collection.get(model)) collection.once('complete:all', () => {
model = collection.get(model);
model.trigger('focus', model);
});
// Nobody is listening for the following event, except when we are
// re-focusing as discussed above **and** the route ends in `/edit`.
this.trigger('reopen-edit-annotation', newDetailView, model);
Expand Down

0 comments on commit 59d5713

Please sign in to comment.