From 0d74428624cde1ec116e601984ac11e2d1782976 Mon Sep 17 00:00:00 2001 From: Jaco Date: Tue, 18 Jan 2022 11:15:19 +0100 Subject: [PATCH] Relay accounts on common-good & system paras (#6740) * Relay accounts on common-good & system paras * Revert useEndpoint * Add relay values to current * Ordering --- CHANGELOG.md | 7 +++++++ packages/react-api/src/Api.tsx | 10 +++++++--- packages/react-hooks/src/index.ts | 10 +++++----- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52f4095707..1589a08796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## master + +Changes: + +- Make relay accounts visible on common-good & system parachains + + ## 0.102.1 Jan 17, 2022 Contributed: diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index 4bf0854bcb..44f24f6add 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -1,6 +1,7 @@ // Copyright 2017-2022 @polkadot/react-api authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { LinkOption } from '@polkadot/apps-config/endpoints/types'; import type { InjectedExtension } from '@polkadot/extension-inject/types'; import type { ChainProperties, ChainType } from '@polkadot/types/interfaces'; import type { KeyringStore } from '@polkadot/ui-keyring/types'; @@ -122,7 +123,7 @@ async function retrieve (api: ApiPromise, injectedPromise: Promise, store: KeyringStore | undefined, types: Record>): Promise { +async function loadOnReady (api: ApiPromise, endpoint: LinkOption | null, injectedPromise: Promise, store: KeyringStore | undefined, types: Record>): Promise { registry.register(types); const { injectedAccounts, properties, systemChain, systemChainType, systemName, systemVersion } = await retrieve(api, injectedPromise); @@ -149,6 +150,9 @@ async function loadOnReady (api: ApiPromise, injectedPromise: Promise { console.error(error); @@ -236,7 +240,7 @@ function Api ({ apiUrl, children, isElectron, store }: Props): React.ReactElemen }); setIsApiInitialized(true); - }, [apiUrl, queuePayload, queueSetTxStatus, store]); + }, [apiEndpoint, apiUrl, queuePayload, queueSetTxStatus, store]); if (!value.isApiInitialized) { return null; diff --git a/packages/react-hooks/src/index.ts b/packages/react-hooks/src/index.ts index 4ce5379686..9ac8e784db 100644 --- a/packages/react-hooks/src/index.ts +++ b/packages/react-hooks/src/index.ts @@ -23,6 +23,7 @@ export { useDebounce } from './useDebounce'; export { useDelegations } from './useDelegations'; export { useDeriveAccountFlags } from './useDeriveAccountFlags'; export { useDeriveAccountInfo } from './useDeriveAccountInfo'; +export { useElementPosition } from './useElementPosition'; export { useEndpoint } from './useEndpoint'; export { useEventTrigger } from './useEventTrigger'; export { useExtrinsicTrigger } from './useExtrinsicTrigger'; @@ -43,16 +44,20 @@ export { useNonZeroBn } from './useNonZeroBn'; export { useOwnEraRewards } from './useOwnEraRewards'; export { useOwnStashes, useOwnStashIds } from './useOwnStashes'; export { useOwnStashInfos } from './useOwnStashInfos'; +export { useOutsideClick } from './useOutsideClick'; export { useParaApi } from './useParaApi'; +export { usePopupWindow } from './usePopupWindow'; export { useProxies } from './useProxies'; export { useIsParasLinked, useParaEndpoints } from './useParaEndpoints'; export { usePassword } from './usePassword'; export { useRegistrars } from './useRegistrars'; export { useSavedFlags } from './useSavedFlags'; +export { useScroll } from './useScroll'; export { useSubidentities } from './useSubidentities'; export { useStakingInfo } from './useStakingInfo'; export { useStepper } from './useStepper'; export { useSudo } from './useSudo'; +export { useSystemApi } from './useSystemApi'; export { useTeleport } from './useTeleport'; export { useToggle } from './useToggle'; export { useTreasury } from './useTreasury'; @@ -60,9 +65,4 @@ export { useTxBatch } from './useTxBatch'; export { useVotingStatus } from './useVotingStatus'; export { useWeight } from './useWeight'; export { useWeightFee } from './useWeightFee'; -export { useElementPosition } from './useElementPosition'; -export { useScroll } from './useScroll'; -export { useSystemApi } from './useSystemApi'; export { useWindowSize } from './useWindowSize'; -export { useOutsideClick } from './useOutsideClick'; -export { usePopupWindow } from './usePopupWindow';