From 95653a1228ecc51e1c092e8d82ae5eb384d847af Mon Sep 17 00:00:00 2001 From: Ysrbolles Date: Fri, 16 Aug 2024 17:53:51 +0100 Subject: [PATCH] chore: Update PlatformSwitcher to use new DAC feature flag logic --- src/components/PlatformSwitcher.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/PlatformSwitcher.tsx b/src/components/PlatformSwitcher.tsx index 12201ea9..17fa7cb9 100644 --- a/src/components/PlatformSwitcher.tsx +++ b/src/components/PlatformSwitcher.tsx @@ -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, @@ -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(false) @@ -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 (