diff --git a/native/account/restore-backup-screen.react.js b/native/account/restore-backup-screen.react.js --- a/native/account/restore-backup-screen.react.js +++ b/native/account/restore-backup-screen.react.js @@ -18,6 +18,7 @@ import { useColors, useStyles } from '../themes/colors.js'; import { appOutOfDateAlertDetails, + networkErrorAlertDetails, unknownErrorAlertDetails, userNotFoundAlertDetails, } from '../utils/alert-messages.js'; @@ -90,6 +91,8 @@ messageForException === 'use_new_flow' ) { alertDetails = appOutOfDateAlertDetails; + } else if (messageForException === 'network_error') { + alertDetails = networkErrorAlertDetails; } else if (messageForException === 'use_v1_flow') { try { await performV1Login(userIdentifier, credentials); diff --git a/native/account/restore-password-account-screen.react.js b/native/account/restore-password-account-screen.react.js --- a/native/account/restore-password-account-screen.react.js +++ b/native/account/restore-password-account-screen.react.js @@ -21,6 +21,7 @@ import { useStyles } from '../themes/colors.js'; import { appOutOfDateAlertDetails, + networkErrorAlertDetails, unknownErrorAlertDetails, userNotFoundAlertDetails, } from '../utils/alert-messages.js'; @@ -127,6 +128,8 @@ messageForException === 'use_new_flow' ) { alertMessage = appOutOfDateAlertDetails; + } else if (messageForException === 'network_error') { + alertMessage = networkErrorAlertDetails; } Alert.alert( alertMessage.title, diff --git a/native/account/restore-prompt-screen.react.js b/native/account/restore-prompt-screen.react.js --- a/native/account/restore-prompt-screen.react.js +++ b/native/account/restore-prompt-screen.react.js @@ -24,6 +24,7 @@ import { useColors, useStyles } from '../themes/colors.js'; import { appOutOfDateAlertDetails, + networkErrorAlertDetails, unknownErrorAlertDetails, } from '../utils/alert-messages.js'; import Alert from '../utils/alert.js'; @@ -98,6 +99,8 @@ title: 'Login attempt timed out', message: 'Please try again', }; + } else if (messageForException === 'network_error') { + alertDetails = networkErrorAlertDetails; } Alert.alert( alertDetails.title, diff --git a/native/utils/alert-messages.js b/native/utils/alert-messages.js --- a/native/utils/alert-messages.js +++ b/native/utils/alert-messages.js @@ -41,6 +41,12 @@ message: 'Uhh... try again?', }; +const networkErrorAlertDetails: AlertDetails = { + title: 'Network error', + message: + 'Failed to contact Comm services. Please check your network connection.', +}; + const getFarcasterAccountAlreadyLinkedAlertDetails = ( commUsername: ?string, ): AlertDetails => ({ @@ -56,5 +62,6 @@ usernameTakenAlertDetails, userNotFoundAlertDetails, unknownErrorAlertDetails, + networkErrorAlertDetails, getFarcasterAccountAlreadyLinkedAlertDetails, };