diff --git a/packages/ui/src/contexts/ApiContext.tsx b/packages/ui/src/contexts/ApiContext.tsx index 5d440b5a..6f9f3b89 100644 --- a/packages/ui/src/contexts/ApiContext.tsx +++ b/packages/ui/src/contexts/ApiContext.tsx @@ -48,8 +48,6 @@ export const DESCRIPTORS = { export type ApiDescriptors = keyof typeof DESCRIPTORS export type Descriptors = (typeof DESCRIPTORS)[Id] -export const getDescriptor = (id: ApiDescriptors): Descriptors => DESCRIPTORS[id] - type ApiContextProps = { children: React.ReactNode | React.ReactNode[] } @@ -83,11 +81,14 @@ const ApiContextProvider = ({ children }: ApiContextP if (!selectedNetworkInfo?.chainId || !selectedNetworkInfo?.descriptor) return const cl = createClient(withPolkadotSdkCompat(getWsProvider(selectedNetworkInfo.rpcUrls))) - - const typedApi = cl.getTypedApi(DESCRIPTORS[selectedNetworkInfo.descriptor]) setClient(cl) - const desc = DESCRIPTORS[selectedNetworkInfo.descriptor] - setApi(typedApi as TypedApi) + const id = selectedNetworkInfo.descriptor as Id + const typedApi = cl.getTypedApi(DESCRIPTORS[id]) + setApi(typedApi as TypedApi>) + + // const typedApi = cl.getTypedApi(DESCRIPTORS[selectedNetworkInfo.descriptor]) + // setClient(cl) + // setApi(typedApi as TypedApi>) setApiDescriptor(selectedNetworkInfo.descriptor) }, [selectedNetworkInfo]) diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 761c9028..d2450b2a 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -16,7 +16,8 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", - "types": ["vite/client", "vite-plugin-svgr/client", "cypress", "node", "cypress-wait-until"] + "types": ["vite/client", "vite-plugin-svgr/client", "cypress", "node", "cypress-wait-until"], + "disableSizeLimit": true }, "include": [ "src/**/*",