Skip to content

Commit 09fbd5f

Browse files
authored
Merge pull request #4316 from vector-im/feature/fga/fix_4313
Fix unread marker not showing
2 parents 0d1382a + a82a5c9 commit 09fbd5f

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

changelog.d/4313.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix unread marker not showing

vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailViewModel.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,9 @@ class RoomDetailViewModel @AssistedInject constructor(
529529
val isAllowed = action.userJustAccepted || if (widget.type == WidgetType.Jitsi) {
530530
widget.senderInfo?.userId == session.myUserId ||
531531
session.integrationManagerService().isNativeWidgetDomainAllowed(
532-
action.widget.type.preferred,
533-
domain
534-
)
532+
action.widget.type.preferred,
533+
domain
534+
)
535535
} else false
536536

537537
if (isAllowed) {
@@ -1092,8 +1092,10 @@ class RoomDetailViewModel @AssistedInject constructor(
10921092
}
10931093

10941094
override fun onTimelineUpdated(snapshot: List<TimelineEvent>) {
1095-
timelineEvents.tryEmit(snapshot)
1096-
1095+
viewModelScope.launch {
1096+
// tryEmit doesn't work with SharedFlow without cache
1097+
timelineEvents.emit(snapshot)
1098+
}
10971099
// PreviewUrl
10981100
if (vectorPreferences.showUrlPreviews()) {
10991101
withState { state ->

vector/src/main/java/im/vector/app/features/workers/signout/ServerBackupStatusViewModel.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import kotlinx.coroutines.flow.MutableSharedFlow
3434
import kotlinx.coroutines.flow.combine
3535
import kotlinx.coroutines.flow.distinctUntilChanged
3636
import kotlinx.coroutines.flow.sample
37+
import kotlinx.coroutines.launch
3738
import org.matrix.android.sdk.api.extensions.orFalse
3839
import org.matrix.android.sdk.api.session.Session
3940
import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME
@@ -110,7 +111,7 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS
110111
if (
111112
crossSigningInfo.getOrNull() == null ||
112113
(crossSigningInfo.getOrNull()?.isTrusted() == true &&
113-
pInfo.getOrNull()?.allKnown().orFalse())
114+
pInfo.getOrNull()?.allKnown().orFalse())
114115
) {
115116
// So 4S is not setup and we have local secrets,
116117
return@combine BannerState.Setup(numberOfKeys = getNumberOfKeysToBackup())
@@ -125,7 +126,9 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS
125126
)
126127
}
127128

128-
keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
129+
viewModelScope.launch {
130+
keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
131+
}
129132
}
130133

131134
/**
@@ -155,7 +158,9 @@ class ServerBackupStatusViewModel @AssistedInject constructor(@Assisted initialS
155158
}
156159

157160
override fun onStateChange(newState: KeysBackupState) {
158-
keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
161+
viewModelScope.launch {
162+
keyBackupFlow.tryEmit(session.cryptoService().keysBackupService().state)
163+
}
159164
keysBackupState.value = newState
160165
}
161166

0 commit comments

Comments
 (0)