Don't recompute fees after done with swap

This commit is contained in:
Tony Giorgio
2023-06-19 18:38:11 -05:00
committed by Paul Miller
parent 869a968587
commit 980a7ce86b

View File

@@ -56,6 +56,7 @@ export default function Swap() {
const [isConnecting, setIsConnecting] = createSignal(false);
const [loading, setLoading] = createSignal(false);
const [done, setDone] = createSignal(false);
const [selectedPeer, setSelectedPeer] = createSignal<string>("");
@@ -123,6 +124,7 @@ export default function Swap() {
if (canSwap()) {
try {
setLoading(true);
setDone(false);
const nodes = await state.mutiny_wallet?.list_nodes();
const firstNode = (nodes[0] as string) || "";
@@ -153,6 +155,7 @@ export default function Swap() {
setChannelOpenResult({ failure_reason: eify(e) });
// showToast(eify(e))
} finally {
setDone(true);
setLoading(false);
}
}
@@ -220,7 +223,7 @@ export default function Swap() {
const feeEstimate = createMemo(() => {
// Balance can go down during swap so...
if (loading() || !!channelOpenResult()) {
if (loading() || !!channelOpenResult() || done()) {
return undefined;
}