Skip to content

Commit

Permalink
fix: sort null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
debendraoli committed Dec 5, 2024
1 parent 75b0f21 commit 524793f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Page/Dashboard/MessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const MessageList: React.FC<MessageListProps> = ({ relayerId }) => {
`/api/relayer?event=GetMessageList&chain=${chain}&limit=${limit}&relayerId=${relayerId}`
)
const data: MessageListResponse = await response.json()
const sortLastTry = data?.message.sort(

const sortLastTry = data?.message?.sort(
(a, b) => new Date(b.lastTry).getTime() - new Date(a.lastTry).getTime()
)
const sortedMessages = sortLastTry?.sort((a, b) => b.sn - a.sn)
Expand Down

0 comments on commit 524793f

Please sign in to comment.