Skip to content

Commit

Permalink
Update AccountName.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed May 20, 2024
1 parent a70dc40 commit fdd2c1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-components/src/AccountName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -181,7 +181,7 @@ function extractIdentity (address: string, identity: DeriveAccountRegistration):

function AccountName ({ children, className = '', defaultName, label, onClick, override, toggle, value, withSidebar }: Props): React.ReactElement<Props> {
const api = useSystemApi();
const info = useAccountInfo2(api, value);
const info = useAccountInfo2(api, value ? String(value) : undefined);
const [name, setName] = useState<React.ReactNode>(() => extractName((value || '').toString(), undefined, defaultName));
const toggleSidebar = useContext(AccountSidebarCtx);

Expand Down

0 comments on commit fdd2c1d

Please sign in to comment.