Skip to content

Commit

Permalink
dashboard: handle empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
panoel committed Jan 10, 2024
1 parent 539152d commit 1d09f2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dashboard/src/components/Monitor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ function DetailBlocks({ chain }: { chain: string }) {
cancelled = true;
};
}, [chain, fromId, currentNetwork]);
const rawMessages = messagesWrapper.data;
let rawMessages = messagesWrapper.data;
if (rawMessages && rawMessages.length === 0) {
rawMessages = null;
}
const lastMessageId = rawMessages && rawMessages[0].id;
const handlePageClick = useCallback(() => {
if (lastMessageId) {
Expand Down

0 comments on commit 1d09f2e

Please sign in to comment.