feat: send from contact details
This commit is contained in:
@@ -23,6 +23,7 @@ import com.bitcointxoko.gudariwallet.ui.receive.ReceiveViewModel
|
||||
import com.bitcointxoko.gudariwallet.ui.send.SendEvent
|
||||
import com.bitcointxoko.gudariwallet.ui.send.SendStrings
|
||||
import com.bitcointxoko.gudariwallet.ui.send.SendViewModel
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.SharingStarted
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.stateIn
|
||||
@@ -116,6 +117,16 @@ class WalletViewModel(
|
||||
|
||||
val sendEvents: SharedFlow<SendEvent> = sendVm.events
|
||||
|
||||
// ── Contact tap-to-pay prefill ────────────────────────────────────────────
|
||||
private val _pendingSend = MutableStateFlow<String?>(null)
|
||||
val pendingSend: StateFlow<String?> get() = _pendingSend
|
||||
|
||||
/** Called by ContactDetailScreen before navigating to the Send tab. */
|
||||
fun prefillSend(address: String) { _pendingSend.value = address }
|
||||
|
||||
/** Called by SendScreen once it has consumed the prefilled address. */
|
||||
fun consumePendingSend() { _pendingSend.value = null }
|
||||
|
||||
fun handleWithdrawScanned(raw: LnurlScanResponse, lnurl: String) {
|
||||
receiveVm.handleWithdrawResponse(raw, lnurl)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user