Skip to content

Commit

Permalink
Allow for parachains with isPeopleForIdentity to access identity from…
Browse files Browse the repository at this point in the history
… people chain (#11160)
  • Loading branch information
TarikGul authored Dec 26, 2024
1 parent fbf7a40 commit 1fc9814
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react-api/src/Api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ApiProps>(
() => 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]
Expand Down

0 comments on commit 1fc9814

Please sign in to comment.