diff --git a/basicswap/templates/wallet.html b/basicswap/templates/wallet.html index 4376a26..30518ed 100644 --- a/basicswap/templates/wallet.html +++ b/basicswap/templates/wallet.html @@ -629,44 +629,44 @@ {# / LTC #} {% else %} - - + var specialCids = [6, 9]; + + if (specialCids.includes(cid) && percent === 1) { + amountInput.setAttribute('data-hidden', 'true'); + amountInput.placeholder = 'Sweep All'; + amountInput.value = ''; + amountInput.disabled = true; + } else if (amountInput.getAttribute('data-hidden') === 'true' && percent !== 1) { + amountInput.value = calculatedAmount.toFixed(8); + amountInput.setAttribute('data-hidden', 'false'); + amountInput.placeholder = ''; + amountInput.disabled = false; + } else { + amountInput.value = calculatedAmount.toFixed(8); + amountInput.placeholder = ''; + amountInput.disabled = false; + } + + var sweepAllCheckbox = document.getElementById('sweepall'); + if (sweepAllCheckbox) { + if (specialCids.includes(cid) && percent === 1) { + sweepAllCheckbox.checked = true; + } else { + sweepAllCheckbox.checked = false; + } + } + } + {% endif %}