Fix send after approval message (#1178)

* Fix send after approval message

* Fix logic

* Utilise isLocalNumber
This commit is contained in:
Andrew 2023-05-11 09:32:38 +09:30 committed by GitHub
parent 2b00729df3
commit 8dbabec4e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -667,7 +667,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
}
private fun updateSendAfterApprovalText() {
binding?.textSendAfterApproval?.isGone = viewModel.recipient?.hasApprovedMe() ?: true
binding?.textSendAfterApproval?.isVisible = viewModel.showSendAfterApprovalText
}
private fun showOrHideInputIfNeeded() {

View File

@ -31,6 +31,9 @@ class ConversationViewModel(
private val storage: Storage
) : ViewModel() {
val showSendAfterApprovalText: Boolean
get() = recipient?.run { isContactRecipient && !isLocalNumber && !hasApprovedMe() } ?: false
private val _uiState = MutableStateFlow(ConversationUiState())
val uiState: StateFlow<ConversationUiState> = _uiState