diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/drafts/DraftListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/drafts/DraftListScreen.kt index 64f529a3d..8d6df52e0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/drafts/DraftListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/drafts/DraftListScreen.kt @@ -32,6 +32,7 @@ import androidx.compose.foundation.lazy.itemsIndexed import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Delete import androidx.compose.material3.AlertDialog +import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton @@ -74,6 +75,7 @@ fun DraftListScreen( RenderDraftListScreen(accountViewModel.feedStates.drafts, accountViewModel, nav) } +@OptIn(ExperimentalMaterial3Api::class) @Composable private fun RenderDraftListScreen( feedState: FeedContentState, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/wallet/WalletViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/wallet/WalletViewModel.kt index 770ae0cbd..b7cc666aa 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/wallet/WalletViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/wallet/WalletViewModel.kt @@ -82,6 +82,7 @@ enum class TransactionFilter { } private const val NWC_TIMEOUT_MS = 30_000L +private const val PAYMENT_FAILED = "Payment failed" class WalletViewModel : ViewModel() { private var account: Account? = null @@ -301,14 +302,14 @@ class WalletViewModel : ViewModel() { is PayInvoiceErrorResponse -> { _sendState.value = SendState.Error( - response.error?.message ?: "Payment failed", + response.error?.message ?: PAYMENT_FAILED, ) } is NwcErrorResponse -> { _sendState.value = SendState.Error( - response.error?.message ?: "Payment failed", + response.error?.message ?: PAYMENT_FAILED, ) } @@ -318,7 +319,7 @@ class WalletViewModel : ViewModel() { } } } catch (e: Exception) { - _sendState.value = SendState.Error(e.message ?: "Payment failed") + _sendState.value = SendState.Error(e.message ?: PAYMENT_FAILED) } } }