Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/polkassembly/polkassembly i…
Browse files Browse the repository at this point in the history
…nto feature/kr/track-level-analytics-api
  • Loading branch information
KanishkaRajputd committed Apr 24, 2024
2 parents 4ee4e63 + f3f8f93 commit 79b9e68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/ui-components/BeneficiariesListing/Beneficiary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ const Beneficiary = ({ className, beneficiary, disableBalanceFormatting, inPostH
<Address
displayInline
iconSize={20}
address={typeof beneficiary.address === 'string' ? beneficiary.address : ((beneficiary.address as any)?.value as string)}
address={
typeof beneficiary.address === 'string'
? beneficiary.address
: (beneficiary.address as any)?.value.length
? (beneficiary.address as any)?.value.length
: ((beneficiary?.address as any)?.value.interior?.value?.id as string) || ''
}
inPostHeading={inPostHeading}
/>
<span className='text-blue-light-high dark:text-blue-dark-high'>
Expand Down
4 changes: 3 additions & 1 deletion src/util/getEncodedAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export default function getEncodedAddress(address: any, network: string): string

const newAddress = address?.value || address;

if (newAddress?.startsWith('0x')) return newAddress;
if (newAddress.length) {
if (newAddress?.startsWith('0x')) return newAddress;
}

try {
return encodeAddress(newAddress, ss58Format);
Expand Down

0 comments on commit 79b9e68

Please sign in to comment.