Skip to content

Commit 5311cf2

Browse files
committed
Change action to only "Done" when there is a verification failure.
1 parent fff7c04 commit 5311cf2

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/outgoing/VerifySelfSessionStateMachine.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ class VerifySelfSessionStateMachine @Inject constructor(
6666
}
6767
}
6868
inState<State.Canceled> {
69-
on { _: Event.RequestVerification, state ->
70-
state.override { State.RequestingVerification.andLogStateChange() }
71-
}
7269
on { _: Event.Reset, state ->
7370
state.override { State.Initial.andLogStateChange() }
7471
}

features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/outgoing/VerifySelfSessionView.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,11 @@ private fun VerifySelfSessionBottomMenu(
290290
VerificationBottomMenu {
291291
Button(
292292
modifier = Modifier.fillMaxWidth(),
293-
text = stringResource(R.string.screen_session_verification_positive_button_canceled),
294-
onClick = { eventSink(VerifySelfSessionViewEvents.RequestVerification) },
295-
)
296-
TextButton(
297-
modifier = Modifier.fillMaxWidth(),
298-
text = stringResource(CommonStrings.action_cancel),
293+
text = stringResource(CommonStrings.action_done),
299294
onClick = onCancelClick,
300295
)
296+
// Placeholder so the 1st button keeps its vertical position
297+
Spacer(modifier = Modifier.height(40.dp))
301298
}
302299
}
303300
is Step.Ready -> {

features/verifysession/impl/src/test/kotlin/io/element/android/features/verifysession/impl/outgoing/VerifySelfSessionPresenterTest.kt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -186,24 +186,6 @@ class VerifySelfSessionPresenterTest {
186186
}
187187
}
188188

189-
@Test
190-
fun `present - Restart after cancellation returns to requesting verification`() = runTest {
191-
val service = unverifiedSessionService(
192-
requestVerificationLambda = { },
193-
startVerificationLambda = { },
194-
)
195-
val presenter = createVerifySelfSessionPresenter(service)
196-
presenter.test {
197-
val state = requestVerificationAndAwaitVerifyingState(service)
198-
service.emitVerificationFlowState(VerificationFlowState.DidCancel)
199-
assertThat(awaitItem().step).isEqualTo(Step.Canceled)
200-
state.eventSink(VerifySelfSessionViewEvents.RequestVerification)
201-
// Went back to requesting verification
202-
assertThat(awaitItem().step).isEqualTo(Step.AwaitingOtherDeviceResponse)
203-
cancelAndIgnoreRemainingEvents()
204-
}
205-
}
206-
207189
@Test
208190
fun `present - Go back after cancellation returns to initial state`() = runTest {
209191
val service = unverifiedSessionService(

0 commit comments

Comments
 (0)