Skip to content

Commit

Permalink
Throw an error in events list when page number is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Jul 23, 2024
1 parent 0e1ebc9 commit b466a48
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/components/Transactions/TransactionEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ export const TransactionEvents: FC<{
limit,
offset,
})
const { isLoading, data, isError } = eventsQuery
const { isFetched, isLoading, data, isError } = eventsQuery
const events = data?.data.events
if (isFetched && pagination.selectedPage > 1 && !events?.length) {
throw AppErrors.PageDoesNotExist
}

return (
<RuntimeEventsDetailedList
scope={transaction}
events={data?.data?.events}
events={events}
isLoading={isLoading}
isError={isError}
addressSwitchOption={addressSwitchOption}
Expand Down

0 comments on commit b466a48

Please sign in to comment.