Make isLastSession "live"
This commit is contained in:
parent
daa90a0660
commit
6ddc2f5814
9 changed files with 32 additions and 33 deletions
|
|
@ -113,10 +113,7 @@ class RoomListPresenter @Inject constructor(
|
|||
|
||||
var securityBannerDismissed by rememberSaveable { mutableStateOf(false) }
|
||||
val canVerifySession by sessionVerificationService.canVerifySessionFlow.collectAsState(initial = false)
|
||||
var isLastDevice by remember { mutableStateOf(false) }
|
||||
LaunchedEffect(Unit) {
|
||||
isLastDevice = encryptionService.isLastDevice().getOrNull() ?: false
|
||||
}
|
||||
val isLastDevice by encryptionService.isLastDevice.collectAsState()
|
||||
val recoveryState by encryptionService.recoveryStateStateFlow.collectAsState()
|
||||
val syncState by syncService.syncState.collectAsState()
|
||||
val securityBannerState by remember {
|
||||
|
|
|
|||
|
|
@ -243,14 +243,14 @@ class RoomListPresenterTests {
|
|||
coroutineScope = scope,
|
||||
client = FakeMatrixClient(
|
||||
encryptionService = FakeEncryptionService().apply {
|
||||
givenIsLastDevice(true)
|
||||
emitIsLastDevice(true)
|
||||
}
|
||||
),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
skipItems(2)
|
||||
skipItems(1)
|
||||
val eventSink = awaitItem().eventSink
|
||||
// For the last session, the state is not SessionVerification, but RecoveryKeyConfirmation
|
||||
assertThat(awaitItem().securityBannerState).isEqualTo(SecurityBannerState.RecoveryKeyConfirmation)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue