Skip to content

Commit

Permalink
fix: reset document selection on navigating away
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanH90 authored and czosel committed Apr 1, 2022
1 parent 3a3606b commit 2876e49
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addon/routes/application.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Route from "@ember/routing/route";
import { inject as service } from "@ember/service";
import { isEmpty } from "@ember/utils";

const PARAM_OPTIONS = { refreshModel: true };

Expand All @@ -17,6 +18,11 @@ export default class ApplicationRoute extends Route {
model() {}

afterModel(model, transition) {
/* Depending on how ember alexandria is used we might have to reset
the document selection on navigation */
if (isEmpty(transition.to.queryParams)) {
this.documents.clearDocumentSelection();
}
this.config.alexandriaQueryParams = transition.to.parent.params;
this.config.activeGroup = transition.to.queryParams.activeGroup;
}
Expand Down

0 comments on commit 2876e49

Please sign in to comment.