Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 8a9ebc7

Browse files
Show the channel fee warning from federation swap
1 parent f8f0103 commit 8a9ebc7

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/components/ReceiveWarnings.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { FeesModal } from "~/components/MoreInfoModal";
55
import { useI18n } from "~/i18n/context";
66
import { useMegaStore } from "~/state/megaStore";
77

8-
export function ReceiveWarnings(props: { amountSats: string | bigint }) {
8+
export function ReceiveWarnings(props: {
9+
amountSats: string | bigint;
10+
from_fedi_to_ln: boolean;
11+
}) {
912
const i18n = useI18n();
1013
const [state, _actions] = useMegaStore();
1114

@@ -26,7 +29,7 @@ export function ReceiveWarnings(props: { amountSats: string | bigint }) {
2629
});
2730

2831
const warningText = () => {
29-
if (state.federations?.length !== 0) {
32+
if (state.federations?.length !== 0 && props.from_fedi_to_ln != true) {
3033
return undefined;
3134
}
3235
if ((state.balance?.lightning || 0n) === 0n) {

src/routes/Receive.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,10 @@ export function Receive() {
377377
setAmountSats={setAmount}
378378
onSubmit={getQr}
379379
/>
380-
<ReceiveWarnings amountSats={amount() || "0"} />
380+
<ReceiveWarnings
381+
amountSats={amount() || "0"}
382+
from_fedi_to_ln={false}
383+
/>
381384
</VStack>
382385
<div class="flex-1" />
383386
<VStack>

src/routes/SwapLightning.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
MegaEx,
2929
MutinyWalletGuard,
3030
NavBar,
31+
ReceiveWarnings,
3132
showToast,
3233
SuccessModal,
3334
TextField,
@@ -205,6 +206,10 @@ export function SwapLightning() {
205206
}
206207
]}
207208
/>
209+
<ReceiveWarnings
210+
amountSats={amountSats() || "0"}
211+
from_fedi_to_ln={true}
212+
/>
208213
<Show when={amountWarning() && amountSats() > 0n}>
209214
<InfoBox accent={"red"}>{amountWarning()}</InfoBox>
210215
</Show>

0 commit comments

Comments
 (0)