Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some alerts from Receive page #7038

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading