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

Commit 1628a08

Browse files
committed
on-chain warnings and hide zero amounts
1 parent 2504e57 commit 1628a08

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

public/i18n/en.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@
148148
"body": "Lightning receives will automatically go into your chosen federation. You can swap to self-custodial later if you want."
149149
},
150150
"receive_strings_error": "Something went wrong generating an invoice or on-chain address.",
151-
"error_under_min_onchain": "That's under the dust limit! On-chain transactions should be much bigger."
151+
"error_under_min_onchain": "That's under the dust limit! On-chain transactions should be much bigger.",
152+
"warning_on_chain_fedi": "On-chain fedimint deposits require 10 confirmations."
152153
},
153154
"send": {
154155
"search": {
@@ -190,7 +191,8 @@
190191
"hodl_invoice_warning": "This is a hodl invoice. Payments to hodl invoices can cause channel force closes, which results in high on-chain fees. Pay at your own risk!",
191192
"private": "Private",
192193
"publiczap": "Public Zap",
193-
"privatezap": "Private Zap"
194+
"privatezap": "Private Zap",
195+
"warn_address_reuse": "Only send to this address once."
194196
},
195197
"feedback": {
196198
"header": "Give us feedback!",

src/components/ActivityDetailsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function OnchainHeader(props: { info: OnChainTx; kind?: HackActivityType }) {
168168
</Match>
169169
</Switch>
170170
</div>
171-
<Show when={props.kind !== "ChannelClose"}>
171+
<Show when={props.kind !== "ChannelClose" && Number(amount()) > 0}>
172172
<div class="flex flex-col items-center">
173173
<div
174174
class="text-2xl"

src/components/ReceiveWarnings.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createResource, Match, Switch } from "solid-js";
1+
import { createMemo, createResource, Match, Switch } from "solid-js";
22

33
import { InfoBox } from "~/components/InfoBox";
44
import { FeesModal } from "~/components/MoreInfoModal";
@@ -79,6 +79,12 @@ export function ReceiveWarnings(props: {
7979
}
8080
};
8181

82+
const onChainFedi = createMemo(() => {
83+
if (props.flavor === "onchain" && state.federations?.length) {
84+
return true;
85+
}
86+
});
87+
8288
return (
8389
<Switch>
8490
<Match when={tooSmallWarning()}>
@@ -92,6 +98,11 @@ export function ReceiveWarnings(props: {
9298
{warningText()} <FeesModal />
9399
</InfoBox>
94100
</Match>
101+
<Match when={onChainFedi()}>
102+
<InfoBox accent="blue">
103+
{i18n.t("receive.warning_on_chain_fedi")}
104+
</InfoBox>
105+
</Match>
95106
</Switch>
96107
);
97108
}

src/routes/Send.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,11 @@ export function Send() {
830830
<p>{i18n.t("send.hodl_invoice_warning")}</p>
831831
</InfoBox>
832832
</Show>
833+
<Show when={source() === "onchain"}>
834+
<InfoBox accent="blue">
835+
{i18n.t("send.warn_address_reuse")}
836+
</InfoBox>
837+
</Show>
833838
<Show when={error() && !decodingLnUrl()}>
834839
<InfoBox accent="red">
835840
<p>{error()}</p>

0 commit comments

Comments
 (0)