Skip to content

Commit

Permalink
Merge pull request #284 from alleslabs/fix/txs-data-error
Browse files Browse the repository at this point in the history
fix: add data fetching error state to txs page
  • Loading branch information
bkioshn committed Apr 19, 2023
2 parents 5ea08ef + 1d89806 commit b92585d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Improvements

- [#284](https://github.com/alleslabs/celatone-frontend/pull/284) Add data fetching error state to txs page
- [#281](https://github.com/alleslabs/celatone-frontend/pull/281) Change Osmosis mainnet GraphQL
- [#251](https://github.com/alleslabs/celatone-frontend/pull/251) Refactor Code and Contract tables into general components
- [#252](https://github.com/alleslabs/celatone-frontend/pull/252) Refactor Empty State image source logic
Expand Down
11 changes: 10 additions & 1 deletion src/lib/pages/txs/components/TxsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const TxsTable = ({ isViewMore }: TxsTableProps) => {
},
});

const { data: txs, isLoading } = useTxs(offset, pageSize);
const { data: txs, isLoading, error } = useTxs(offset, pageSize);

const onPageChange = (nextPage: number) => {
setCurrentPage(nextPage);
Expand All @@ -48,6 +48,15 @@ export const TxsTable = ({ isViewMore }: TxsTableProps) => {
if (!isViewMore) setPageSize(10);
setCurrentPage(1);
}, [chainId, isViewMore, setCurrentPage, setPageSize]);
// TODO - Might consider adding this state in all transaction table
if (error)
return (
<EmptyState
withBorder
imageVariant="not-found"
message="There is an error during fetching transactions."
/>
);
return (
<>
<TransactionsTable
Expand Down

3 comments on commit b92585d

@vercel
Copy link

@vercel vercel bot commented on b92585d Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on b92585d Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on b92585d Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.