Skip to content

Commit

Permalink
fix: reset query params
Browse files Browse the repository at this point in the history
  • Loading branch information
Yelinz committed Dec 29, 2023
1 parent 89c909f commit 2073a0d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions addon/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default class ApplicationRoute extends Route {
queryParams = {
category: PARAM_OPTIONS,
tags: PARAM_OPTIONS,
marks: PARAM_OPTIONS,
search: PARAM_OPTIONS,
document: PARAM_OPTIONS,
activeGroup: PARAM_OPTIONS,
Expand All @@ -30,4 +31,19 @@ export default class ApplicationRoute extends Route {
this.config.alexandriaQueryParams = transition.to.parent.params;
this.config.activeGroup = transition.to.queryParams.activeGroup;
}

resetController(controller, isExiting) {
// isExiting would be false if only the route's model was changing
if (isExiting) {
controller.setProperties({
category: undefined,
tags: [],
marks: [],
search: undefined,
document: undefined,
activeGroup: undefined,
sort: undefined,
});
}
}
}

0 comments on commit 2073a0d

Please sign in to comment.