mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:05:28 +00:00
Make isLastSession "live"
This commit is contained in:
committed by
Benoit Marty
parent
daa90a0660
commit
6ddc2f5814
+1
-4
@@ -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 {
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user