Skip to content

Commit

Permalink
Fix default preset view (#334)
Browse files Browse the repository at this point in the history
The default view is custom instead of currently active.

The default view should show the most relevant information
to users. This should be the currently active preset view.

Let's change the default view to be currently active.
  • Loading branch information
Arif-Khalid authored Apr 1, 2024
1 parent 6d2d768 commit 44fd3ca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/core/services/filters.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ export class FiltersService {
return;
}

// No preset view and no other filters in params, use default view
if (!presetView && Object.keys(nextFilter).every((filterName) => queryParams.get(filterName) === null)) {
this.updatePresetView('currentlyActive');
return;
}

for (const filterName of Object.keys(nextFilter)) {
const stringifiedFilterData = queryParams.get(filterName);
if (!stringifiedFilterData) {
Expand Down

0 comments on commit 44fd3ca

Please sign in to comment.