File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
app/src/main/java/org/thoughtcrime/securesms/conversation/v2 Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import dagger.assisted.AssistedFactory
14
14
import dagger.assisted.AssistedInject
15
15
import dagger.hilt.android.lifecycle.HiltViewModel
16
16
import kotlinx.coroutines.Dispatchers
17
+ import kotlinx.coroutines.ExperimentalCoroutinesApi
17
18
import kotlinx.coroutines.GlobalScope
18
19
import kotlinx.coroutines.Job
19
20
import kotlinx.coroutines.flow.Flow
@@ -121,6 +122,7 @@ import java.time.ZonedDateTime
121
122
import java.util.EnumSet
122
123
import java.util.UUID
123
124
125
+ @OptIn(ExperimentalCoroutinesApi ::class )
124
126
@HiltViewModel(assistedFactory = ConversationViewModel .Factory ::class )
125
127
class ConversationViewModel @AssistedInject constructor(
126
128
@Assisted val address : Address .Conversable ,
@@ -411,7 +413,9 @@ class ConversationViewModel @AssistedInject constructor(
411
413
}.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), null )
412
414
413
415
val lastSeenMessageId: Flow <MessageId ?>
414
- get() = repository.getLastSentMessageID(threadId)
416
+ get() = threadIdFlow.flatMapLatest { id ->
417
+ repository.getLastSentMessageID(id ? : return @flatMapLatest flowOf(null ))
418
+ }
415
419
416
420
private fun getInputBarState (
417
421
recipient : Recipient ,
You can’t perform that action at this time.
0 commit comments