mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Fix list state navigation (#1765)
* Fix sort direction being lost filtering scenes list Fix thevsort direction being lost on the scenes (& images & galleries?) lists when filtering the list by using the "badges" on the tags / performers / ... popovers. * Fix using back button not clearing filters to empty Fix (re)setting of a lists criterion based on the URL in case the new URL doesn't have criterions / "c" set. When it's unset it should be assumed the criterions must be empty, instead of maintaining the current criterions (which could be populated wirh the old criterions when the list was shown before). * Set page to 1 on list when applying new filter
This commit is contained in:
@@ -79,19 +79,19 @@ export class ListFilterModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.sortDirection =
|
||||
params.sortdir === "desc"
|
||||
? SortDirectionEnum.Desc
|
||||
: SortDirectionEnum.Asc;
|
||||
if (params.sortdir !== undefined) {
|
||||
this.sortDirection =
|
||||
params.sortdir === "desc"
|
||||
? SortDirectionEnum.Desc
|
||||
: SortDirectionEnum.Asc;
|
||||
}
|
||||
if (params.disp !== undefined) {
|
||||
this.displayMode = Number.parseInt(params.disp, 10);
|
||||
}
|
||||
if (params.q) {
|
||||
this.searchTerm = params.q.trim();
|
||||
}
|
||||
if (params.p) {
|
||||
this.currentPage = Number.parseInt(params.p, 10);
|
||||
}
|
||||
this.currentPage = params.p ? Number.parseInt(params.p, 10) : 1;
|
||||
if (params.perPage) this.itemsPerPage = Number.parseInt(params.perPage, 10);
|
||||
if (params.z !== undefined) {
|
||||
const zoomIndex = Number.parseInt(params.z, 10);
|
||||
@@ -100,9 +100,8 @@ export class ListFilterModel {
|
||||
}
|
||||
}
|
||||
|
||||
this.criteria = [];
|
||||
if (params.c !== undefined) {
|
||||
this.criteria = [];
|
||||
|
||||
let jsonParameters: string[];
|
||||
if (params.c instanceof Array) {
|
||||
jsonParameters = params.c;
|
||||
|
||||
Reference in New Issue
Block a user