Don't expand search filters automatically if popping from Back action.
The existing behavior of automatically expanding when needed && when entering the page is still maintained.
This commit is contained in:
parent
defcda519e
commit
87e53db699
1 changed files with 4 additions and 2 deletions
|
@ -102,7 +102,7 @@ function ClaimListDiscover(props: Props) {
|
|||
|
||||
const [page, setPage] = useState(1);
|
||||
const [forceRefresh, setForceRefresh] = useState();
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
const [expanded, setExpanded] = usePersistedState(`expanded-${location.pathname}`, false);
|
||||
const [orderParamEntry, setOrderParamEntry] = useState(CS.ORDER_BY_TRENDING);
|
||||
const [orderParamUser, setOrderParamUser] = usePersistedState(`orderUser-${location.pathname}`, CS.ORDER_BY_TRENDING);
|
||||
const followed = (followedTags && followedTags.map(t => t.name)) || [];
|
||||
|
@ -132,7 +132,9 @@ function ClaimListDiscover(props: Props) {
|
|||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (isFiltered()) setExpanded(true);
|
||||
if (history.action !== 'POP' && isFiltered()) {
|
||||
setExpanded(true);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue