Skip to content

Commit

Permalink
fix(RSS3): mf-5365 some actions may not have address_to (#10813)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleBill committed Sep 21, 2023
1 parent c83fd31 commit 8e4c2de
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function TokenOperationCard({ feed, ...rest }: TokenFeedCardProps) {
const t = useI18N()
const { classes, cx } = useStyles()

const action = feed.actions[0]
const action = feed.actions.find((x) => x.address_from && x.address_to) || feed.actions[0]
const metadata = action.metadata

const owner = useFeedOwner()
Expand All @@ -94,8 +94,8 @@ export function TokenOperationCard({ feed, ...rest }: TokenFeedCardProps) {
const cardType = cardTypeMap[feed.type] || (isFromOwner ? CardType.TokenOut : CardType.TokenIn)
const context = contextMap[feed.type] || (isFromOwner ? 'send' : 'claim')

const from = useAddressLabel(action.address_from!)
const to = useAddressLabel(action.address_to!)
const from = useAddressLabel(action.address_from ?? '')
const to = useAddressLabel(action.address_to ?? '')

return (
<CardFrame type={cardType} feed={feed} {...rest}>
Expand Down

0 comments on commit 8e4c2de

Please sign in to comment.