Skip to content

Commit 2620954

Browse files
committed
fix: remove NotFoundError handling and simplify error check in useAddressData
1 parent e6e7e01 commit 2620954

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/routes/$chainSlug/_layout/address/$addressAddress.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import { AddressWorkerpoolsTable } from '@/modules/addresses/address/workerpools
2727
import { AddressContributionTable } from '@/modules/addresses/address/workers/beneficiaryDeals/addressContributionTable';
2828
import { SearcherBar } from '@/modules/search/SearcherBar';
2929
import useUserStore from '@/stores/useUser.store';
30-
import { NotFoundError } from '@/utils/NotFoundError';
3130
import { isValidAddress } from '@/utils/addressOrIdCheck';
3231
import { createPlaceholderDataFnForQueryKey } from '@/utils/createPlaceholderDataFnForQueryKey';
3332

@@ -49,9 +48,6 @@ function useAddressData(address: string, chainId: number) {
4948
length: TABLE_LENGTH,
5049
address,
5150
});
52-
if (!result?.account) {
53-
throw new NotFoundError();
54-
}
5551
return result;
5652
},
5753
refetchInterval: TABLE_REFETCH_INTERVAL,
@@ -149,7 +145,7 @@ function AddressRoute() {
149145
return <ErrorAlert className="my-16" message="Invalid address." />;
150146
}
151147

152-
if (isError && error instanceof NotFoundError) {
148+
if (isError && error) {
153149
return (
154150
<ErrorAlert className="my-16" message="No data found for this address." />
155151
);

0 commit comments

Comments
 (0)