File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/src/main/java/to/bitkit/viewmodels Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1046,9 +1046,12 @@ class AppViewModel @Inject constructor(
10461046 if (_sendUiState .value.showSanityWarningDialog != null ) return
10471047
10481048 val settings = settingsStore.data.first()
1049-
1049+ val balanceToCheck = when (_sendUiState .value.payMethod) {
1050+ SendMethod .ONCHAIN -> walletRepo.balanceState.value.maxSendOnchainSats
1051+ SendMethod .LIGHTNING -> walletRepo.balanceState.value.maxSendLightningSats
1052+ }
10501053 if (
1051- amountSats > BigDecimal .valueOf(walletRepo.balanceState.value.totalSats .toLong())
1054+ amountSats > BigDecimal .valueOf(balanceToCheck .toLong())
10521055 .times(BigDecimal (MAX_BALANCE_FRACTION )).toLong().toUInt() &&
10531056 SanityWarning .OVER_HALF_BALANCE !in _sendUiState .value.confirmedWarnings
10541057 ) {
You can’t perform that action at this time.
0 commit comments