Skip to content

Commit

Permalink
Display proper swap error
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Jul 1, 2024
1 parent 175bdf9 commit 86190e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/SwapLightning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function SwapLightning() {
return feeSats() !== 0n;
});

const [feeEstimateWarning, setFeeEstimateWarning] = createSignal<string>();
const [feeEstimateWarning, setFeeEstimateWarning] = createSignal<Error>();

const feeEstimate = async () => {
try {
Expand All @@ -146,7 +146,7 @@ export function SwapLightning() {
setStage("preview");
} catch (e) {
console.error(e);
setFeeEstimateWarning(i18n.t("swap_lightning.too_small"));
setFeeEstimateWarning(eify(e));
} finally {
setLoading(false);
}
Expand Down Expand Up @@ -256,7 +256,7 @@ export function SwapLightning() {
<Suspense>
<Show when={feeEstimateWarning()}>
<InfoBox accent={"red"}>
{feeEstimateWarning()}
{feeEstimateWarning()?.message}
</InfoBox>
</Show>
</Suspense>
Expand Down

0 comments on commit 86190e8

Please sign in to comment.