Commit 56a99525 authored by Jack Short's avatar Jack Short Committed by GitHub

fix: bag autoclose when going to collection page (#5311)

* fix: bag autoclose when going to collection page

* moved eslint comment
parent 7059a12a
...@@ -72,6 +72,7 @@ const Collection = () => { ...@@ -72,6 +72,7 @@ const Collection = () => {
const isActivityToggled = pathname.includes('/activity') const isActivityToggled = pathname.includes('/activity')
const setMarketCount = useCollectionFilters((state) => state.setMarketCount) const setMarketCount = useCollectionFilters((state) => state.setMarketCount)
const isBagExpanded = useBag((state) => state.bagExpanded) const isBagExpanded = useBag((state) => state.bagExpanded)
const setBagExpanded = useBag((state) => state.setBagExpanded)
const { chainId } = useWeb3React() const { chainId } = useWeb3React()
const collectionStats = useCollectionQuery(contractAddress as string) const collectionStats = useCollectionQuery(contractAddress as string)
...@@ -100,6 +101,11 @@ const Collection = () => { ...@@ -100,6 +101,11 @@ const Collection = () => {
setMarketCount(marketCount) setMarketCount(marketCount)
}, [collectionStats?.marketplaceCount, setMarketCount]) }, [collectionStats?.marketplaceCount, setMarketCount])
useEffect(() => {
setBagExpanded({ bagExpanded: false, manualClose: false })
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
const toggleActivity = () => { const toggleActivity = () => {
isActivityToggled isActivityToggled
? navigate(`/nfts/collection/${contractAddress}`) ? navigate(`/nfts/collection/${contractAddress}`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment