From fdd2c1d72ddacaaa4d4dc063c82e6bcc59835717 Mon Sep 17 00:00:00 2001 From: Kami Date: Mon, 20 May 2024 13:32:52 +0330 Subject: [PATCH] Update AccountName.tsx --- packages/react-components/src/AccountName.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-components/src/AccountName.tsx b/packages/react-components/src/AccountName.tsx index 4c4b35e2cb77..15934fa2a62a 100644 --- a/packages/react-components/src/AccountName.tsx +++ b/packages/react-components/src/AccountName.tsx @@ -8,7 +8,7 @@ import type { AccountId, AccountIndex, Address } from '@polkadot/types/interface import React, { useCallback, useContext, useEffect, useState } from 'react'; import { statics } from '@polkadot/react-api/statics'; -import { useAccountInfo2, useDeriveAccountInfo, useSystemApi } from '@polkadot/react-hooks'; +import { useAccountInfo2, useSystemApi } from '@polkadot/react-hooks'; import { AccountSidebarCtx } from '@polkadot/react-hooks/ctx/AccountSidebar'; import { formatNumber, isCodec, isFunction, stringToU8a, u8aEmpty, u8aEq, u8aToBn } from '@polkadot/util'; @@ -181,7 +181,7 @@ function extractIdentity (address: string, identity: DeriveAccountRegistration): function AccountName ({ children, className = '', defaultName, label, onClick, override, toggle, value, withSidebar }: Props): React.ReactElement { const api = useSystemApi(); - const info = useAccountInfo2(api, value); + const info = useAccountInfo2(api, value ? String(value) : undefined); const [name, setName] = useState(() => extractName((value || '').toString(), undefined, defaultName)); const toggleSidebar = useContext(AccountSidebarCtx);