From defc231f6749a05e579a436a97d8e89c81509395 Mon Sep 17 00:00:00 2001 From: Marc-Aurele Besner <82244926+marc-aurele-besner@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:39:32 -0500 Subject: [PATCH] fix network type change in examples --- examples/next/src/hooks/useNetwork.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/next/src/hooks/useNetwork.tsx b/examples/next/src/hooks/useNetwork.tsx index fd56808a..867c87d3 100644 --- a/examples/next/src/hooks/useNetwork.tsx +++ b/examples/next/src/hooks/useNetwork.tsx @@ -1,4 +1,4 @@ -import { networks } from '@autonomys/auto-utils' +import { NetworkId, networks } from '@autonomys/auto-utils' import { useParams } from 'next/navigation' import { useCallback, useEffect, useMemo, useState } from 'react' @@ -17,7 +17,7 @@ export const useNetwork = () => { const listOfNetworks = useMemo(() => networks.map((network) => network.id), []) const handleNetworkChange = useCallback( - (networkId: string) => { + (networkId: NetworkId) => { if (!listOfNetworks.includes(networkId)) { throw new Error(`Network ${networkId} not found`) } @@ -29,7 +29,7 @@ export const useNetwork = () => { useEffect(() => { if (networkName && config.networkId !== networkName && Array.isArray(networkName) === false) - handleNetworkChange(networkName) + handleNetworkChange(networkName as NetworkId) }, [networkName]) return { config, handleNetworkChange }