From 4b0a06cef71d45a6ea357b5ece64803fd3e14e2d Mon Sep 17 00:00:00 2001 From: infinite-persistence <64950861+infinite-persistence@users.noreply.github.com> Date: Thu, 28 Oct 2021 22:51:13 +0800 Subject: [PATCH] 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. --- ui/component/claimListHeader/view.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/component/claimListHeader/view.jsx b/ui/component/claimListHeader/view.jsx index 24c3dfadd..d6f2280a1 100644 --- a/ui/component/claimListHeader/view.jsx +++ b/ui/component/claimListHeader/view.jsx @@ -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') {