From 44fd3ca4c69dfd50ee8d825c5c318255530b3963 Mon Sep 17 00:00:00 2001 From: Arif Khalid <88131400+Arif-Khalid@users.noreply.github.com> Date: Mon, 1 Apr 2024 12:14:43 +0800 Subject: [PATCH] Fix default preset view (#334) 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. --- src/app/core/services/filters.service.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/core/services/filters.service.ts b/src/app/core/services/filters.service.ts index 10c48680..1a7541c3 100644 --- a/src/app/core/services/filters.service.ts +++ b/src/app/core/services/filters.service.ts @@ -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) {