Merge pull request #4316 from vector-im/feature/fga/fix_4313

Fix unread marker not showing
This commit is contained in:
Benoit Marty 2021-10-22 15:42:22 +02:00 committed by GitHub
commit 09fbd5fcf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 8 deletions

1
changelog.d/4313.bugfix Normal file
View File

@ -0,0 +1 @@
Fix unread marker not showing

View File

@ -1092,8 +1092,10 @@ class RoomDetailViewModel @AssistedInject constructor(
} }
override fun onTimelineUpdated(snapshot: List<TimelineEvent>) { override fun onTimelineUpdated(snapshot: List<TimelineEvent>) {
timelineEvents.tryEmit(snapshot) viewModelScope.launch {
// tryEmit doesn't work with SharedFlow without cache
timelineEvents.emit(snapshot)
}
// PreviewUrl // PreviewUrl
if (vectorPreferences.showUrlPreviews()) { if (vectorPreferences.showUrlPreviews()) {
withState { state -> withState { state ->

View File

@ -34,6 +34,7 @@ import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.sample import kotlinx.coroutines.flow.sample
import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
@ -125,8 +126,10 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS
) )
} }
viewModelScope.launch {
keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state) keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
} }
}
/** /**
* Safe way to get the current KeysBackup version * Safe way to get the current KeysBackup version
@ -155,7 +158,9 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS
} }
override fun onStateChange(newState: KeysBackupState) { override fun onStateChange(newState: KeysBackupState) {
viewModelScope.launch {
keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state) keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
}
keysBackupState.value = newState keysBackupState.value = newState
} }