Skip to content

Commit

Permalink
chore: avoid hydratation error on dev when filters are actives
Browse files Browse the repository at this point in the history
  • Loading branch information
jycssu-com committed Nov 22, 2023
1 parent 61d377e commit 6f08985
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/assetsView/filters/AssetsViewFilterButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC } from 'react'
import { FC, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'

import { Button, Indicator } from '@mantine/core'
Expand All @@ -15,7 +15,11 @@ export const AssetsViewFilterButton: FC = () => {
})
const modals = useModals()
const [currentFilter] = useAtom(assetsViewFilterAtom)
const hasActiveFilter = !_isEqual(currentFilter, assetsViewDefaultFilter)
const [hasActiveFilter, setHasActiveFilter] = useState(false)

useEffect(() => {
setHasActiveFilter(!_isEqual(currentFilter, assetsViewDefaultFilter))
})

function openModal() {
modals.openContextModal('assetsViewFilterModal', { innerProps: {} })
Expand Down

0 comments on commit 6f08985

Please sign in to comment.