mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-02-19 05:04:19 +01:00
Don't recompute fees after done with swap
This commit is contained in:
committed by
Paul Miller
parent
869a968587
commit
980a7ce86b
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user