From 59d5713d11a95b987a85338bff7629beb33bda26 Mon Sep 17 00:00:00 2001 From: Julian Gonggrijp Date: Thu, 6 Jan 2022 03:20:57 +0100 Subject: [PATCH] Don't wait for sort event after complete:all on annotation deep link This was preventing focus on annotation deep link. --- frontend/src/explorer/explorer-event-controller.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/explorer/explorer-event-controller.ts b/frontend/src/explorer/explorer-event-controller.ts index 9b955ac3..257c7c11 100644 --- a/frontend/src/explorer/explorer-event-controller.ts +++ b/frontend/src/explorer/explorer-event-controller.ts @@ -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);