diff --git a/app/src/main/java/org/thoughtcrime/securesms/registration/fragments/ReRegisterWithPinFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/registration/fragments/ReRegisterWithPinFragment.kt index 94442d2e0c..df042ae441 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/registration/fragments/ReRegisterWithPinFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/registration/fragments/ReRegisterWithPinFragment.kt @@ -139,10 +139,10 @@ class ReRegisterWithPinFragment : LoggingFragment(R.layout.pin_restore_entry_fra onSkipPinEntry() } else if (processor.isServerSentError()) { Log.i(TAG, "Error from server, not likely recoverable", processor.error) - Toast.makeText(requireContext(), R.string.RegistrationActivity_error_connecting_to_service, Toast.LENGTH_LONG).show() + genericErrorDialog() } else { Log.i(TAG, "Unexpected error occurred", processor.error) - Toast.makeText(requireContext(), R.string.RegistrationActivity_error_connecting_to_service, Toast.LENGTH_LONG).show() + genericErrorDialog() } } } @@ -246,4 +246,11 @@ class ReRegisterWithPinFragment : LoggingFragment(R.layout.pin_restore_entry_fra registrationViewModel.setUserSkippedReRegisterFlow(true) findNavController().safeNavigate(R.id.action_reRegisterWithPinFragment_to_enterPhoneNumberFragment) } + + private fun genericErrorDialog() { + MaterialAlertDialogBuilder(requireContext()) + .setMessage(R.string.RegistrationActivity_error_connecting_to_service) + .setPositiveButton(android.R.string.ok, null) + .show() + } }