mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-23 00:17:34 +00:00
Fix buttons
This commit is contained in:
parent
d0415c5bf1
commit
fbb2172739
@ -80,8 +80,6 @@ import javax.inject.Inject
|
||||
@AndroidEntryPoint
|
||||
class MessageDetailActivity : PassphraseRequiredActionBarActivity() {
|
||||
|
||||
private var timestamp: Long = 0L
|
||||
|
||||
@Inject
|
||||
lateinit var storage: Storage
|
||||
|
||||
@ -101,7 +99,7 @@ class MessageDetailActivity : PassphraseRequiredActionBarActivity() {
|
||||
|
||||
title = resources.getString(R.string.conversation_context__menu_message_details)
|
||||
|
||||
intent.getLongExtra(MESSAGE_TIMESTAMP, -1L).let(viewModel::setMessageTimestamp)
|
||||
viewModel.timestamp = intent.getLongExtra(MESSAGE_TIMESTAMP, -1L)
|
||||
|
||||
ComposeView(this)
|
||||
.apply { setContent { MessageDetailsScreen() } }
|
||||
@ -135,7 +133,7 @@ class MessageDetailActivity : PassphraseRequiredActionBarActivity() {
|
||||
}
|
||||
|
||||
private fun setResultAndFinish(code: Int) {
|
||||
Bundle().apply { putLong(MESSAGE_TIMESTAMP, timestamp) }
|
||||
Bundle().apply { putLong(MESSAGE_TIMESTAMP, viewModel.timestamp) }
|
||||
.let(Intent()::putExtras)
|
||||
.let { setResult(code, it) }
|
||||
|
||||
|
@ -46,7 +46,9 @@ class MessageDetailsViewModel @Inject constructor(
|
||||
private val event = Channel<Event>()
|
||||
val eventFlow = event.receiveAsFlow()
|
||||
|
||||
fun setMessageTimestamp(timestamp: Long) {
|
||||
var timestamp: Long = 0L
|
||||
set(value) {
|
||||
field = value
|
||||
val record = mmsSmsDatabase.getMessageForTimestamp(timestamp)
|
||||
|
||||
if (record == null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user