diff --git a/packages/page-settings/src/Metadata/NetworkSpecs.tsx b/packages/page-settings/src/Metadata/NetworkSpecs.tsx index 3b9a03bbd986..47e49fbaa3f4 100644 --- a/packages/page-settings/src/Metadata/NetworkSpecs.tsx +++ b/packages/page-settings/src/Metadata/NetworkSpecs.tsx @@ -1,12 +1,13 @@ // Copyright 2017-2023 @polkadot/app-settings authors & contributors // SPDX-License-Identifier: Apache-2.0 +import store from 'store'; import type { NetworkSpecsStruct } from '@polkadot/ui-settings/types'; import type { ChainInfo, ChainType } from '../types.js'; import React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'; -import { ChainImg, Input, QrNetworkSpecs, Spinner, styled, Table } from '@polkadot/react-components'; +import { Button, ChainImg, Input, QrNetworkSpecs, Spinner, styled, Table } from '@polkadot/react-components'; import { useApi, useDebounce } from '@polkadot/react-hooks'; import { useTranslation } from '../translate.js'; @@ -61,17 +62,21 @@ function NetworkSpecs ({ chainInfo, className }: Props): React.ReactElement(); useEffect((): void => { - chainInfo && setNetworkSpecs({ - chainType: chainInfo.chainType, - color: chainInfo.color || getRandomColor(), - decimals: chainInfo.tokenDecimals, - genesisHash: chainInfo.genesisHash, - prefix: chainInfo.ss58Format, - title: systemChain, - unit: chainInfo.tokenSymbol - }); + if (chainInfo) { + setNetworkSpecs({ + chainType: chainInfo.chainType, + color: chainInfo.color || getRandomColor(), + decimals: chainInfo.tokenDecimals, + genesisHash: chainInfo.genesisHash, + prefix: chainInfo.ss58Format, + title: systemChain, + unit: chainInfo.tokenSymbol, + }); + setUserExtensions(chainInfo.userExtensions ? Object.keys(chainInfo.userExtensions) : undefined); + } }, [chainInfo, systemChain]); const _onChangeColor = useCallback( @@ -120,7 +125,7 @@ function NetworkSpecs ({ chainInfo, className }: Props): React.ReactElement - + {qrData.genesisHash && ( + + + ('User extensions')} + value={userExtensions && userExtensions.length > 0 ? userExtensions.join(", ") : "No signed / user extensions found"} + /> + + + + + +