Merge pull request #6677 from hughns/hughns/qr-grant-error-mapping
Update error mappings for Link new device flow
This commit is contained in:
commit
414da30d33
1 changed files with 12 additions and 10 deletions
|
|
@ -191,20 +191,22 @@ class LinkNewDeviceFlowNode(
|
||||||
|
|
||||||
private fun navigateToError(errorType: ErrorType) {
|
private fun navigateToError(errorType: ErrorType) {
|
||||||
// Map the error to an error screen
|
// Map the error to an error screen
|
||||||
// TODO Update this mapping
|
|
||||||
val error = when (errorType) {
|
val error = when (errorType) {
|
||||||
is ErrorType.DeviceIdAlreadyInUse -> ErrorScreenType.UnknownError
|
is ErrorType.InvalidCheckCode -> ErrorScreenType.Mismatch2Digits
|
||||||
is ErrorType.InvalidCheckCode -> ErrorScreenType.InsecureChannelDetected
|
is ErrorType.UnsupportedProtocol -> ErrorScreenType.ProtocolNotSupported
|
||||||
is ErrorType.MissingSecretsBackup -> ErrorScreenType.UnknownError
|
is ErrorType.Cancelled -> ErrorScreenType.Cancelled
|
||||||
is ErrorType.NotFound -> ErrorScreenType.Expired
|
|
||||||
is ErrorType.DeviceNotFound -> ErrorScreenType.UnknownError
|
|
||||||
is ErrorType.Unknown -> ErrorScreenType.UnknownError
|
|
||||||
is ErrorType.UnsupportedProtocol -> ErrorScreenType.UnknownError
|
|
||||||
is ErrorType.Cancelled -> ErrorScreenType.UnknownError
|
|
||||||
is ErrorType.ConnectionInsecure -> ErrorScreenType.InsecureChannelDetected
|
is ErrorType.ConnectionInsecure -> ErrorScreenType.InsecureChannelDetected
|
||||||
is ErrorType.Expired -> ErrorScreenType.Expired
|
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.UnknownError
|
||||||
|
// TODO check if we expect to hit this here or if it should be caught earlier on
|
||||||
is ErrorType.UnsupportedQrCodeType -> ErrorScreenType.UnknownError
|
is ErrorType.UnsupportedQrCodeType -> ErrorScreenType.UnknownError
|
||||||
|
is ErrorType.MissingSecretsBackup,
|
||||||
|
is ErrorType.DeviceIdAlreadyInUse,
|
||||||
|
is ErrorType.Unknown -> ErrorScreenType.UnknownError
|
||||||
}
|
}
|
||||||
// It is OK to push on backstack, since when user leaves the error screen, a new root will be set,
|
// It is OK to push on backstack, since when user leaves the error screen, a new root will be set,
|
||||||
// or the whole flow will be popped.
|
// or the whole flow will be popped.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue