mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Merge pull request #6688 from element-hq/feature/bma/errorAlreadySignedIn
[Link new device] Add missing error case "already signed in"
This commit is contained in:
+1
-3
@@ -199,9 +199,7 @@ class LinkNewDeviceFlowNode(
|
||||
is ErrorType.Expired,
|
||||
is ErrorType.NotFound,
|
||||
is ErrorType.DeviceNotFound -> ErrorScreenType.Expired
|
||||
// TODO we should show other_device_already_signed_in screen with checkmark when available
|
||||
// See: https://github.com/element-hq/element-x-android/issues/6678
|
||||
is ErrorType.OtherDeviceAlreadySignedIn -> ErrorScreenType.UnknownError
|
||||
is ErrorType.OtherDeviceAlreadySignedIn -> ErrorScreenType.OtherDeviceAlreadySignedIn
|
||||
// TODO check if we expect to hit this here or if it should be caught earlier on
|
||||
is ErrorType.UnsupportedQrCodeType -> ErrorScreenType.UnknownError
|
||||
is ErrorType.MissingSecretsBackup,
|
||||
|
||||
+3
@@ -20,6 +20,9 @@ sealed interface ErrorScreenType : NodeInputs, Parcelable {
|
||||
@Parcelize
|
||||
data object Expired : ErrorScreenType
|
||||
|
||||
@Parcelize
|
||||
data object OtherDeviceAlreadySignedIn : ErrorScreenType
|
||||
|
||||
@Parcelize
|
||||
data object Mismatch2Digits : ErrorScreenType
|
||||
|
||||
|
||||
+1
@@ -19,5 +19,6 @@ class ErrorScreenTypeProvider : PreviewParameterProvider<ErrorScreenType> {
|
||||
ErrorScreenType.InsecureChannelDetected,
|
||||
ErrorScreenType.SlidingSyncNotAvailable,
|
||||
ErrorScreenType.UnknownError,
|
||||
ErrorScreenType.OtherDeviceAlreadySignedIn,
|
||||
)
|
||||
}
|
||||
|
||||
+27
-5
@@ -47,17 +47,26 @@ fun ErrorView(
|
||||
) {
|
||||
val appName = LocalBuildMeta.current.applicationName
|
||||
BackHandler(onBack = onCancel)
|
||||
val iconStyle = when (errorScreenType) {
|
||||
ErrorScreenType.OtherDeviceAlreadySignedIn -> BigIcon.Style.SuccessSolid
|
||||
else -> BigIcon.Style.AlertSolid
|
||||
}
|
||||
FlowStepPage(
|
||||
modifier = modifier,
|
||||
iconStyle = BigIcon.Style.AlertSolid,
|
||||
iconStyle = iconStyle,
|
||||
title = titleText(errorScreenType, appName),
|
||||
subTitle = subtitleText(errorScreenType, appName),
|
||||
content = { Content(errorScreenType) },
|
||||
buttons = {
|
||||
Buttons(
|
||||
onRetry = onRetry,
|
||||
onCancel = onCancel,
|
||||
)
|
||||
when (errorScreenType) {
|
||||
ErrorScreenType.OtherDeviceAlreadySignedIn -> DoneButton(
|
||||
onDone = onCancel,
|
||||
)
|
||||
else -> Buttons(
|
||||
onRetry = onRetry,
|
||||
onCancel = onCancel,
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -72,6 +81,7 @@ private fun titleText(errorScreenType: ErrorScreenType, appName: String) = when
|
||||
ErrorScreenType.Mismatch2Digits -> stringResource(id = R.string.screen_link_new_device_wrong_number_title)
|
||||
ErrorScreenType.SlidingSyncNotAvailable -> stringResource(id = R.string.screen_qr_code_login_error_sliding_sync_not_supported_title, appName)
|
||||
is ErrorScreenType.UnknownError -> stringResource(CommonStrings.common_something_went_wrong)
|
||||
ErrorScreenType.OtherDeviceAlreadySignedIn -> stringResource(R.string.screen_qr_code_login_error_device_already_signed_in_title)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -84,6 +94,7 @@ private fun subtitleText(errorScreenType: ErrorScreenType, appName: String) = wh
|
||||
ErrorScreenType.InsecureChannelDetected -> stringResource(id = R.string.screen_qr_code_login_connection_note_secure_state_description)
|
||||
ErrorScreenType.SlidingSyncNotAvailable -> stringResource(id = R.string.screen_qr_code_login_error_sliding_sync_not_supported_subtitle, appName)
|
||||
is ErrorScreenType.UnknownError -> stringResource(R.string.screen_qr_code_login_unknown_error_description)
|
||||
ErrorScreenType.OtherDeviceAlreadySignedIn -> stringResource(R.string.screen_qr_code_login_error_device_already_signed_in_subtitle)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -124,6 +135,17 @@ private fun Content(errorScreenType: ErrorScreenType) {
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DoneButton(
|
||||
onDone: () -> Unit,
|
||||
) {
|
||||
Button(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = stringResource(CommonStrings.action_done),
|
||||
onClick = onDone,
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Buttons(
|
||||
onRetry: () -> Unit,
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ fun FlowStepPage(
|
||||
},
|
||||
header = {
|
||||
IconTitleSubtitleMolecule(
|
||||
modifier = Modifier.padding(bottom = 16.dp),
|
||||
modifier = Modifier.padding(bottom = 16.dp, start = 8.dp, end = 8.dp),
|
||||
title = title,
|
||||
subTitle = subTitle,
|
||||
iconStyle = iconStyle,
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fe92b35b0fe2e5481eeb497f2ada1a639cb1a66f937b4245798edffea75b1f5c
|
||||
size 35932
|
||||
oid sha256:d30e200c3e73775ed7081d3fbdc9f8843c5a5bf9e5f1b9ab3535cc6f0ea7f1f6
|
||||
size 35946
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7f6bc4bb2233067ab6d07e596f8d5ca294501a47a21451a1115aa46e238b31a5
|
||||
size 34996
|
||||
oid sha256:a78b0677d896de960ce8ce7c5818b1d52004c91917c73c460a605e5e1342554f
|
||||
size 35129
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user