Skip to content

Commit

Permalink
fix: update display token name when search with token address hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Feb 1, 2023
1 parent 9535bf1 commit 64399c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/Search/SearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ export default function SearchResult({ status, data }: SearchResultProps) {
if (addresses && addresses.length > 0) {
for (let item of addresses) {
if (!items.find((i: SearchResultViewItem) => item.addressHash === i.key)) {
const name = item.name || item.tokenName || item.contractName
items.push({
time: item.insertedAt,
type: 'Address',
key: item.addressHash,
value: item.name ? `${item.name} | ${item.addressHash}` : item.addressHash,
value: name ? `${name} | ${item.addressHash}` : item.addressHash,
linkValue: item.addressHash
})
}
Expand Down
4 changes: 3 additions & 1 deletion types/address.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ interface AddressTransactionResponse {
interface AddressSearchResponse {
addressHash: string
address: string
name: string
name?: string
tokenName?: string
contractName?: string
insertedAt: string
}

Expand Down

0 comments on commit 64399c7

Please sign in to comment.