Skip to content

Commit d462386

Browse files
committed
Remove code duplication - no behavior change.
1 parent 9ea0a11 commit d462386

File tree

1 file changed

+6
-13
lines changed
  • features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/outgoing

1 file changed

+6
-13
lines changed

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

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -248,25 +248,18 @@ private fun VerifySelfSessionBottomMenu(
248248
Step.Loading -> error("Should not happen")
249249
is Step.Initial -> {
250250
VerificationBottomMenu {
251-
if (verificationViewState.isLastDevice) {
252-
Button(
253-
modifier = Modifier.fillMaxWidth(),
254-
text = stringResource(R.string.screen_session_verification_enter_recovery_key),
255-
onClick = onEnterRecoveryKey,
256-
)
257-
} else {
251+
if (verificationViewState.isLastDevice.not()) {
258252
Button(
259253
modifier = Modifier.fillMaxWidth(),
260254
text = stringResource(R.string.screen_identity_use_another_device),
261255
onClick = { eventSink(VerifySelfSessionViewEvents.RequestVerification) },
262256
)
263-
Button(
264-
modifier = Modifier.fillMaxWidth(),
265-
text = stringResource(R.string.screen_session_verification_enter_recovery_key),
266-
onClick = onEnterRecoveryKey,
267-
)
268257
}
269-
// This option should always be displayed
258+
Button(
259+
modifier = Modifier.fillMaxWidth(),
260+
text = stringResource(R.string.screen_session_verification_enter_recovery_key),
261+
onClick = onEnterRecoveryKey,
262+
)
270263
OutlinedButton(
271264
modifier = Modifier.fillMaxWidth(),
272265
text = stringResource(R.string.screen_identity_confirmation_cannot_confirm),

0 commit comments

Comments
 (0)