Skip to content

Commit

Permalink
handle connection errors more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed Aug 16, 2023
1 parent a6d5589 commit b50883b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
31 changes: 31 additions & 0 deletions src/components/SetupErrorDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,37 @@ export default function SetupErrorDisplay(props: { initialError: Error }) {
return (
<SafeArea>
<Switch>
<Match
when={error.message.startsWith("Network connection closed")}
>
<DefaultMain>
<LargeHeader>
{i18n.t("error.on_boot.loading_failed.header")}
</LargeHeader>
<p class="bg-white/10 rounded-xl p-4 font-mono">
<span class="font-bold">{error.name}</span>:{" "}
{error.message}
</p>
<NiceP>
{i18n.t(
"error.on_boot.loading_failed.services_down"
)}
</NiceP>
<NiceP>
Follow us on{" "}
<ExternalLink href="https://primal.net/p/npub1mutnyacc9uc4t5mmxvpprwsauj5p2qxq95v4a9j0jxl8wnkfvuyque23vg">
Nostr
</ExternalLink>{" "}
or{" "}
<ExternalLink href="https://twitter.com/MutinyWallet">
Twitter
</ExternalLink>{" "}
for updates.
</NiceP>

<ErrorFooter />
</DefaultMain>
</Match>
<Match when={error.message.startsWith("Existing tab")}>
<Title>{i18n.t("error.on_boot.existing_tab.title")}</Title>
<DefaultMain>
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/en/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,9 @@ export default {
"If your wallet seems broken, here are some tools to try to debug and repair it.",
questions:
"If you have any questions on what these buttons do, please",
support_link: "reach out to us for support."
support_link: "reach out to us for support.",
services_down:
"It looks like one of Mutiny's services is down. Please try again later."
}
}
},
Expand Down

0 comments on commit b50883b

Please sign in to comment.