Skip to content

Commit

Permalink
Remove some alerts from Receive page
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelekol committed Feb 7, 2024
1 parent a609354 commit 87ba749
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,11 @@ class DepositAddressViewModel(
return items
}

private fun getAlertText(hasMemo: Boolean): ReceiveModule.AlertText {
return when {
hasMemo -> ReceiveModule.AlertText.Critical(
Translator.getString(R.string.Balance_Receive_AddressMemoAlert)
)

else -> ReceiveModule.AlertText.Normal(
Translator.getString(R.string.Balance_Receive_AddressAlert)
)
}
private fun getAlertText(hasMemo: Boolean): ReceiveModule.AlertText? {
return if (hasMemo) ReceiveModule.AlertText.Critical(
Translator.getString(R.string.Balance_Receive_AddressMemoAlert)
)
else null
}

fun onErrorClick() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object ReceiveModule {
val watchAccount: Boolean,
val additionalItems: List<AdditionalData>,
val amount: BigDecimal?,
val alertText: AlertText,
val alertText: AlertText?,
)

sealed class AlertText {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ fun ReceiveAddressScreen(
horizontalAlignment = Alignment.CenterHorizontally,
) {
VSpacer(12.dp)
WarningTextView(uiState.alertText)
uiState.alertText?.let {
WarningTextView(it)
}
VSpacer(12.dp)
Column(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ReceiveAddressViewModel(
private var networkName = ""
private var mainNet = true
private var watchAccount = wallet.account.isWatchAccount
private var alertText: ReceiveModule.AlertText = getAlertText(watchAccount)
private var alertText: ReceiveModule.AlertText? = getAlertText(watchAccount)

var uiState by mutableStateOf(
ReceiveModule.UiState(
Expand Down Expand Up @@ -90,15 +90,11 @@ class ReceiveAddressViewModel(
syncState()
}

private fun getAlertText(watchAccount: Boolean): ReceiveModule.AlertText {
return when {
watchAccount -> ReceiveModule.AlertText.Normal(
Translator.getString(R.string.Balance_Receive_WatchAddressAlert)
)
else -> ReceiveModule.AlertText.Normal(
Translator.getString(R.string.Balance_Receive_AddressAlert)
)
}
private fun getAlertText(watchAccount: Boolean): ReceiveModule.AlertText? {
return if (watchAccount) ReceiveModule.AlertText.Normal(
Translator.getString(R.string.Balance_Receive_WatchAddressAlert)
)
else null
}

private fun setData() {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@
<string name="Balance_Receive_Memo">Memo (Tag)</string>
<string name="Balance_Error_InvalidQrCode">Impossível Reconhecer</string>
<string name="Balance_Receive_WatchAddressAlert">Esse endereço é o endereço da conta observada. Envie apenas tokens compatíveis com a rede.</string>
<string name="Balance_Receive_AddressAlert">Apenas tokens compatíveis com a rede. Outros serão perdidos.</string>
<string name="Balance_Receive_AddressMemoAlert">Forneça o Memo necessário (Tag) e envie apenas tokens compatíveis com a rede. Outros serão perdidos.</string>
<!--Send NFT-->
<string name="SendNft_Title">Enviar</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@
<string name="Balance_Receive_Memo">Memo (Tag)</string>
<string name="Balance_Error_InvalidQrCode">Can\'t recognize</string>
<string name="Balance_Receive_WatchAddressAlert">This address is the address of the watched account. Send only network-compatible tokens.</string>
<string name="Balance_Receive_AddressAlert">Network-compatible tokens only. Others will be lost.</string>
<string name="Balance_Receive_AddressMemoAlert">Provide required Memo (Tag) and send only network-compatible tokens. Others will be lost.</string>
<string name="Balance_Receive_UsedAddresses">Used Addresses</string>
<string name="Balance_Receive_UsedAddressesDescriptoin">%s addresses change for privacy and security. Below a list of used addresses in this wallet.</string>
Expand Down

0 comments on commit 87ba749

Please sign in to comment.