Skip to content

Commit

Permalink
Enable apiIdentity for Polkadot (#10751)
Browse files Browse the repository at this point in the history
* Enable apiIdentity for Polkadot

* remove consoles
  • Loading branch information
TarikGul authored Jul 12, 2024
1 parent 889e03d commit 1a44e92
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/react-api/src/Api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,9 @@ export function ApiCtxRoot ({ apiUrl, children, isElectron, store: keyringStore
() => makeCreateLink(apiUrl, isElectron),
[apiUrl, isElectron]
);
// TODO: Once the people migration is complete for polkadot, we can remove the polkadot check at the end.
const enableIdentity = apiEndpoint?.isPeople || (isNumber(apiEndpoint?.paraId) && (apiEndpoint?.paraId >= 2000)) || apiEndpoint?.info?.toLowerCase() === 'paseo';
// TODO remove `(apiEndpoint?.relayName === 'polkadot' && !apiEndpoint?.isRelay && apiRelay)` once polkadot is migrated over to the people chain for identities.
const value = useMemo<ApiProps>(
() => objectSpread({}, state, { api: statics.api, apiEndpoint, apiError, apiIdentity: (apiEndpoint?.relayName === 'polkadot' && !apiEndpoint?.isRelay && apiRelay) || ((apiEndpoint?.isPeopleForIdentity && apiSystemPeople) || statics.api), apiRelay, apiSystemPeople, apiUrl, createLink, enableIdentity, extensions, isApiConnected, isApiInitialized, isElectron, isLocalFork, isWaitingInjected: !extensions }),
() => objectSpread({}, state, { api: statics.api, 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, apiRelay, apiUrl, apiSystemPeople, enableIdentity]
);

Expand Down

0 comments on commit 1a44e92

Please sign in to comment.