From 1fe7ed79038e7d9e4f625bfe663c39c9dbea347d Mon Sep 17 00:00:00 2001 From: Tarik Gul <47201679+TarikGul@users.noreply.github.com> Date: Wed, 23 Sep 2026 15:24:34 -0400 Subject: [PATCH] Remove redundant type registration in loadOnReady (#12448) The types are already registered on the same registry via the ApiPromise constructor, so re-registering them here is a no-op for the intended case. --- packages/react-api/src/Api.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index c4fae44b5d..3ad49a6307 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -133,9 +133,7 @@ async function retrieve (api: ApiPromise, injectedPromise: Promise, store: KeyringStore | undefined, types: Record>, urlIsEthereum = false): Promise { - statics.registry.register(types); - +async function loadOnReady (api: ApiPromise, endpoint: LinkOption | null, fork: Blockchain | null, injectedPromise: Promise, store: KeyringStore | undefined, urlIsEthereum = false): Promise { const { injectedAccounts, properties, systemChain, systemChainType, systemName, systemVersion } = await retrieve(api, injectedPromise); const chainSS58 = properties.ss58Format.unwrapOr(DEFAULT_SS58).toNumber(); const ss58Format = settings.prefix === -1 @@ -354,7 +352,7 @@ export function ApiCtxRoot ({ apiUrl, beforeApiInit, children, isElectron, store }; createApi(apiUrl, new ApiSigner(statics.registry, queuePayload, queueSetTxStatus), isLocalFork, onError) - .then(({ fork, types }): void => { + .then(({ fork }): void => { statics.api.on('connected', () => setIsApiConnected(true)); statics.api.on('disconnected', () => setIsApiConnected(false)); statics.api.on('error', onError); @@ -367,7 +365,7 @@ export function ApiCtxRoot ({ apiUrl, beforeApiInit, children, isElectron, store const urlIsEthereum = !!location.href.includes('keyring-type=ethereum'); - loadOnReady(statics.api, apiEndpoint, fork, injectedPromise, keyringStore, types, urlIsEthereum) + loadOnReady(statics.api, apiEndpoint, fork, injectedPromise, keyringStore, urlIsEthereum) .then(setState) .catch(onError); });