mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
Change action to only "Done" when there is a verification failure.
This commit is contained in:
-3
@@ -66,9 +66,6 @@ class VerifySelfSessionStateMachine @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
inState<State.Canceled> {
|
inState<State.Canceled> {
|
||||||
on { _: Event.RequestVerification, state ->
|
|
||||||
state.override { State.RequestingVerification.andLogStateChange() }
|
|
||||||
}
|
|
||||||
on { _: Event.Reset, state ->
|
on { _: Event.Reset, state ->
|
||||||
state.override { State.Initial.andLogStateChange() }
|
state.override { State.Initial.andLogStateChange() }
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-6
@@ -290,14 +290,11 @@ private fun VerifySelfSessionBottomMenu(
|
|||||||
VerificationBottomMenu {
|
VerificationBottomMenu {
|
||||||
Button(
|
Button(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
text = stringResource(R.string.screen_session_verification_positive_button_canceled),
|
text = stringResource(CommonStrings.action_done),
|
||||||
onClick = { eventSink(VerifySelfSessionViewEvents.RequestVerification) },
|
|
||||||
)
|
|
||||||
TextButton(
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
text = stringResource(CommonStrings.action_cancel),
|
|
||||||
onClick = onCancelClick,
|
onClick = onCancelClick,
|
||||||
)
|
)
|
||||||
|
// Placeholder so the 1st button keeps its vertical position
|
||||||
|
Spacer(modifier = Modifier.height(40.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is Step.Ready -> {
|
is Step.Ready -> {
|
||||||
|
|||||||
-18
@@ -186,24 +186,6 @@ class VerifySelfSessionPresenterTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `present - Restart after cancellation returns to requesting verification`() = runTest {
|
|
||||||
val service = unverifiedSessionService(
|
|
||||||
requestVerificationLambda = { },
|
|
||||||
startVerificationLambda = { },
|
|
||||||
)
|
|
||||||
val presenter = createVerifySelfSessionPresenter(service)
|
|
||||||
presenter.test {
|
|
||||||
val state = requestVerificationAndAwaitVerifyingState(service)
|
|
||||||
service.emitVerificationFlowState(VerificationFlowState.DidCancel)
|
|
||||||
assertThat(awaitItem().step).isEqualTo(Step.Canceled)
|
|
||||||
state.eventSink(VerifySelfSessionViewEvents.RequestVerification)
|
|
||||||
// Went back to requesting verification
|
|
||||||
assertThat(awaitItem().step).isEqualTo(Step.AwaitingOtherDeviceResponse)
|
|
||||||
cancelAndIgnoreRemainingEvents()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - Go back after cancellation returns to initial state`() = runTest {
|
fun `present - Go back after cancellation returns to initial state`() = runTest {
|
||||||
val service = unverifiedSessionService(
|
val service = unverifiedSessionService(
|
||||||
|
|||||||
Reference in New Issue
Block a user