From bf5d0eecb13393995db02d61ab3bccaf89923457 Mon Sep 17 00:00:00 2001 From: tarikgul Date: Thu, 26 Dec 2024 11:47:55 -0500 Subject: [PATCH] Allow for parachains with isPeopleForIdentity to access identity from people chain --- packages/react-api/src/Api.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index 011fbf5cff8..d945096431d 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -323,7 +323,11 @@ export function ApiCtxRoot ({ apiUrl, children, isElectron, store: keyringStore () => makeCreateLink(apiUrl, isElectron), [apiUrl, isElectron] ); - const enableIdentity = apiEndpoint?.isPeople || (isNumber(apiEndpoint?.paraId) && (apiEndpoint?.paraId >= 2000)) || (typeof apiEndpoint?.isPeopleForIdentity === 'boolean' && !apiEndpoint?.isPeopleForIdentity); + const enableIdentity = apiEndpoint?.isPeople || + // Ensure that parachains that don't have isPeopleForIdentity set, can access there own identity pallet. + (isNumber(apiEndpoint?.paraId) && (apiEndpoint?.paraId >= 2000) && !apiEndpoint?.isPeopleForIdentity) || + // Ensure that when isPeopleForIdentity is set to false that it enables the identity pallet access. + (typeof apiEndpoint?.isPeopleForIdentity === 'boolean' && !apiEndpoint?.isPeopleForIdentity); const value = useMemo( () => objectSpread({}, state, { api: statics.api, apiCoretime, apiEndpoint, apiError, apiIdentity: ((apiEndpoint?.isPeopleForIdentity && apiSystemPeople) || statics.api), apiRelay, apiSystemPeople, apiUrl, createLink, enableIdentity, extensions, isApiConnected, isApiInitialized, isElectron, isLocalFork, isWaitingInjected: !extensions }), [apiError, createLink, extensions, isApiConnected, isApiInitialized, isElectron, isLocalFork, state, apiEndpoint, apiCoretime, apiRelay, apiUrl, apiSystemPeople, enableIdentity]