Updated on 2026-08-14

This commit is contained in:
Tangem 2020-12-09 15:24:50 +03:00
parent db1bf3e135
commit abba81ed41
9 changed files with 26 additions and 6 deletions

View file

@ -33,7 +33,7 @@ sealed class AddressPayIdActionUi : SendScreenActionUi {
object CheckAddressPayId : AddressPayIdActionUi()
data class SetTruncateHandler(val handler: (String) -> String) : AddressPayIdActionUi()
data class TruncateOrRestore(val truncate: Boolean) : AddressPayIdActionUi()
data class ChangePayIdState(val walletPayIdEnabled: Boolean): AddressPayIdActionUi()
data class ChangePayIdState(val sendingToPayIdEnabled: Boolean): AddressPayIdActionUi()
}
sealed class AddressPayIdVerifyAction : SendScreenAction {

View file

@ -160,6 +160,6 @@ internal class AddressPayIdMiddleware {
}
private fun isPayIdEnabled(): Boolean {
return store.state.globalState.configManager?.config?.isWalletPayIdEnabled ?: false
return store.state.globalState.configManager?.config?.isSendingToPayIdEnabled ?: false
}
}

View file

@ -30,7 +30,7 @@ class AddressPayIdReducer : SendInternalReducer {
is AddressPayIdActionUi.PasteAddressPayId -> return sendState
is AddressPayIdActionUi.CheckClipboard -> return sendState
is AddressPayIdActionUi.CheckAddressPayId -> return sendState
is AddressPayIdActionUi.ChangePayIdState -> state.copy(walletPayIdEnabled = action.walletPayIdEnabled)
is AddressPayIdActionUi.ChangePayIdState -> state.copy(sendingToPayIdEnabled = action.sendingToPayIdEnabled)
}
return updateLastState(sendState.copy(addressPayIdState = result), result)
}

View file

@ -9,7 +9,7 @@ data class AddressPayIdState(
val recipientWalletAddress: String? = null,
val error: AddressPayIdVerifyAction.Error? = null,
val truncateHandler: ((String) -> String)? = null,
val walletPayIdEnabled: Boolean = false,
val sendingToPayIdEnabled: Boolean = false,
val pasteIsEnabled: Boolean = false
) : SendScreenState {

View file

@ -104,7 +104,7 @@ class SendStateSubscriber(fragment: BaseStoreFragment) : FragmentStateSubscriber
val til = fg.tilAddressOrPayId
val parsedError = parseError(til.context, state.error)
val hintResId = if (state.walletPayIdEnabled) {
val hintResId = if (state.sendingToPayIdEnabled) {
R.string.send_destination_hint_address_payid
}else {
R.string.send_destination_hint_address