Skip to content

Commit

Permalink
fix(explorer): the error on transaction page, should hide loader (#2505)
Browse files Browse the repository at this point in the history
* fix the errors on transaction apge

* set errors setting globally
  • Loading branch information
sstraatemans authored Sep 18, 2024
1 parent 19a8320 commit 511f578
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .changeset/famous-grapes-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions packages/apps/explorer/src/context/networksContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ const getApolloClient = (network: INetwork) => {
const client: ApolloClient<NormalizedCacheObject> = new ApolloClient({
link: splitLink,
cache,
assumeImmutableResults: true,
connectToDevTools: true,
defaultOptions: {
query: { errorPolicy: 'all' },
},
});

return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,14 @@ const Transaction: React.FC = () => {
setIsLoading(false);
}

console.log(666, data);
if (data) {
console.log(444);
setTimeout(() => {
console.log(22);
setIsLoading(false);
setInnerData(data);
}, 200);
}
}, [loading, data, error, setIsLoading]);

if (error) {
return (
<Layout>
<LayoutHeader>An error occured</LayoutHeader>
</Layout>
);
}

return (
<Layout>
{innerData && innerData.transaction ? (
Expand Down

0 comments on commit 511f578

Please sign in to comment.