Skip to content

Commit

Permalink
chore: Update PlatformSwitcher to use new DAC feature flag logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysrbolles authored and aeddaqqa committed Nov 28, 2024
1 parent b714f56 commit 95653a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/PlatformSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, { useEffect, useState } from 'react'
import { useDispatch } from 'react-redux'
import { useNavigate } from 'react-router-dom'
import { useAppSelector } from '../hooks/reduxHooks'
import useWallet from '../hooks/useWallet'
import useWidth from '../hooks/useWidth'
import {
changeActiveApp,
Expand All @@ -25,6 +26,7 @@ export default function PlatformSwitcher() {
const themeMode = theme.palette.mode === 'light' ? true : false
const { isDesktop } = useWidth()
const dispatch = useDispatch()
const { getUpgradePhases } = useWallet()

const [featureEnabled, setFeatureEnabled] = useState<boolean>(false)

Expand All @@ -33,10 +35,12 @@ export default function PlatformSwitcher() {
}, [activeNetwork])

const checkFeature = async () => {
const enabled = await isFeatureEnabled('DACFeature', activeNetwork?.url)
const phases = await getUpgradePhases()
const enabled = await isFeatureEnabled('DACFeature', activeNetwork?.url, phases)

setFeatureEnabled(enabled)
}

return (
<Box
sx={{
Expand Down

0 comments on commit 95653a1

Please sign in to comment.