mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-28 19:34:26 +01:00
Don't check swap max fees when amount is 0
This commit is contained in:
committed by
Paul Miller
parent
980a7ce86b
commit
5a64de87df
@@ -153,9 +153,8 @@ export default function Swap() {
|
||||
}
|
||||
} catch (e) {
|
||||
setChannelOpenResult({ failure_reason: eify(e) });
|
||||
// showToast(eify(e))
|
||||
} finally {
|
||||
setDone(true);
|
||||
setDone(true);
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
@@ -228,11 +227,16 @@ export default function Swap() {
|
||||
}
|
||||
|
||||
// If max we want to use the sweep fee estimator
|
||||
if (amountSats() === maxOnchain()) {
|
||||
return state.mutiny_wallet?.estimate_sweep_channel_open_fee();
|
||||
if (amountSats() >= 0n && amountSats() === maxOnchain()) {
|
||||
try {
|
||||
return state.mutiny_wallet?.estimate_sweep_channel_open_fee();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
if (amountSats()) {
|
||||
if (amountSats() >= 0n) {
|
||||
try {
|
||||
return state.mutiny_wallet?.estimate_tx_fee(
|
||||
CHANNEL_FEE_ESTIMATE_ADDRESS,
|
||||
@@ -241,7 +245,6 @@ export default function Swap() {
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
// showToast(eify(new Error("Unsufficient funds")))
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user