Skip to content

Commit 82b5733

Browse files
author
devofficer
committed
chore: change useCheckLightCurate returning type to object
1 parent 54145bb commit 82b5733

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/hooks/use-check-light-curate.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { useParams } from 'react-router'
33
import { useQuery } from '@apollo/client'
44
import { TCR_EXISTENCE_TEST } from 'utils/graphql'
55

6-
const useCheckLightCurate = (): [boolean, boolean] => {
6+
const useCheckLightCurate = (): {
7+
isLightCurate: boolean
8+
checking: boolean
9+
} => {
710
const { tcrAddress } = useParams<{ tcrAddress: string }>()
811
const { loading, data } = useQuery(TCR_EXISTENCE_TEST, {
912
variables: {
@@ -12,7 +15,7 @@ const useCheckLightCurate = (): [boolean, boolean] => {
1215
})
1316
const isLightCurate = useMemo<boolean>(() => data?.lregistry ?? false, [data])
1417

15-
return [isLightCurate, loading]
18+
return { isLightCurate, checking: loading }
1619
}
1720

1821
export default useCheckLightCurate

src/pages/item-details-router.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ const ItemDetailsRouter = () => {
2929
}>()
3030
const { networkStatus } = useTcrNetwork()
3131
const search = window.location.search
32-
const [isLightCurate, checkingLightCurate] = useCheckLightCurate()
32+
const { isLightCurate, checking } = useCheckLightCurate()
3333

34-
if (checkingLightCurate || networkStatus !== NETWORK_STATUS.supported)
35-
return <Loading />
34+
if (checking || networkStatus !== NETWORK_STATUS.supported) return <Loading />
3635

3736
if (isLightCurate)
3837
return (

src/pages/items-router.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ const Items = loadable(
2424

2525
const ItemsRouter = () => {
2626
const { tcrAddress } = useParams<{ tcrAddress: string }>()
27-
const [isLightCurate, checkingLightCurate] = useCheckLightCurate()
27+
const { isLightCurate, checking } = useCheckLightCurate()
2828
const { networkStatus } = useTcrNetwork()
2929

30-
if (checkingLightCurate || networkStatus !== NETWORK_STATUS.supported)
31-
return <Loading />
30+
if (checking || networkStatus !== NETWORK_STATUS.supported) return <Loading />
3231

3332
if (isLightCurate)
3433
return (

0 commit comments

Comments
 (0)