diff --git a/src/main.tsx b/src/main.tsx index 2a8e7e774..10e805db4 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -7,14 +7,11 @@ import './assets/css/sentry.css'; import './assets/css/Toast.css'; import './insights'; import { runMigrations } from './hooks/utils/cache/runMigrations'; -import { useSetNetworkConfig } from './providers/NetworkConfig/NetworkConfigProvider'; import { useNetworkConfigStore } from './providers/NetworkConfig/useNetworkConfigStore'; import Providers from './providers/Providers'; import { router } from './router'; function DecentRouterProvider() { - useSetNetworkConfig(); - const { addressPrefix } = useNetworkConfigStore(); const urlParams = new URLSearchParams(window.location.search); const addressWithPrefix = urlParams.get('dao'); diff --git a/src/providers/NetworkConfig/NetworkConfigProvider.tsx b/src/providers/NetworkConfig/NetworkConfigProvider.tsx deleted file mode 100644 index 2ce3cc619..000000000 --- a/src/providers/NetworkConfig/NetworkConfigProvider.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { useEffect } from 'react'; -import { useChainId } from 'wagmi'; -import { useNetworkConfigStore } from './useNetworkConfigStore'; - -// Custom hook to use the network config -export const useSetNetworkConfig = () => { - const { getConfigByChainId, setCurrentConfig } = useNetworkConfigStore(); - const currentChainId = useChainId(); - - // Update currentConfig when chainId changes - useEffect(() => { - try { - const newConfig = getConfigByChainId(currentChainId); - setCurrentConfig(newConfig); - } catch (error) { - console.error(error); - } - }, [currentChainId, getConfigByChainId, setCurrentConfig]); -};