Ensure filter is not expanded when disabled (#153)

## Issue
- Go to a channel page
- Go to Wild West
- Back
- Expand the search filter (valid here)
- Forward

## Fix
Resolve the 'expanded' setting on mount to ensure it is never true when 'hideAdvancedFilter' is set.
This commit is contained in:
infinite-persistence 2021-10-28 22:51:13 +08:00 committed by GitHub
parent 00d28fe26e
commit 4b0a06cef7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,6 +106,13 @@ function ClaimListHeader(props: Props) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
React.useEffect(() => {
if (hideAdvancedFilter) {
setExpanded(false);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy;
if (!orderParam) {
if (action === 'POP') {