Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feature/auto horizon error #1195

Merged
merged 8 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion @shared/api/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ export const getAccountIndexerBalances = async (
if ("error" in data && (data?.error?.horizon || data?.error?.soroban)) {
const _err = JSON.stringify(data.error);
captureException(`Failed to fetch account balances - ${_err}`);
throw new Error(_err);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

throw an error here leads to the redux thunk rejecting - which just leads to the generic Failed to fetch account balances error. If we don't throw, we can show the user a Horizon specific error

}

const formattedBalances = {} as NonNullable<
Expand Down
2 changes: 1 addition & 1 deletion extension/src/popup/views/Account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export const Account = () => {
/>
</div>
)}
{!isFunded && !hasError && (
{!isFunded && !hasError && !error?.horizon && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't show the unfunded message if we have a horizon message bc we're not sure if you're funded or not

<NotFundedMessage
canUseFriendbot={!!networkDetails.friendbotUrl}
setIsAccountFriendbotFunded={setIsAccountFriendbotFunded}
Expand Down
Loading