Page MenuHomePhabricator

D12082.diff
No OneTemporary

D12082.diff

diff --git a/native/account/fullscreen-siwe-panel.react.js b/native/account/fullscreen-siwe-panel.react.js
--- a/native/account/fullscreen-siwe-panel.react.js
+++ b/native/account/fullscreen-siwe-panel.react.js
@@ -22,7 +22,10 @@
AccountDoesNotExistRouteName,
RegistrationRouteName,
} from '../navigation/route-names.js';
-import { unknownErrorAlertDetails } from '../utils/alert-messages.js';
+import {
+ unknownErrorAlertDetails,
+ appOutOfDateAlertDetails,
+} from '../utils/alert-messages.js';
import Alert from '../utils/alert.js';
type Props = {
@@ -104,6 +107,16 @@
const messageForException = getMessageForException(e);
if (messageForException === 'nonce expired') {
onNonceExpired('login');
+ } else if (
+ messageForException === 'Unsupported version' ||
+ messageForException === 'client_version_unsupported'
+ ) {
+ Alert.alert(
+ appOutOfDateAlertDetails.title,
+ appOutOfDateAlertDetails.message,
+ [{ text: 'OK', onPress: goBackToPrompt }],
+ { cancelable: false },
+ );
} else {
throw e;
}
@@ -148,14 +161,24 @@
e.message === 'account_does_not_exist'
) {
await onAccountDoesNotExist(result);
- return;
+ } else if (
+ e instanceof ServerError &&
+ e.message === 'client_version_unsupported'
+ ) {
+ Alert.alert(
+ appOutOfDateAlertDetails.title,
+ appOutOfDateAlertDetails.message,
+ [{ text: 'OK', onPress: goBackToPrompt }],
+ { cancelable: false },
+ );
+ } else {
+ Alert.alert(
+ unknownErrorAlertDetails.title,
+ unknownErrorAlertDetails.message,
+ [{ text: 'OK', onPress: goBackToPrompt }],
+ { cancelable: false },
+ );
}
- Alert.alert(
- unknownErrorAlertDetails.title,
- unknownErrorAlertDetails.message,
- [{ text: 'OK', onPress: goBackToPrompt }],
- { cancelable: false },
- );
return;
}
dispatch({
diff --git a/native/account/log-in-panel.react.js b/native/account/log-in-panel.react.js
--- a/native/account/log-in-panel.react.js
+++ b/native/account/log-in-panel.react.js
@@ -348,7 +348,10 @@
[{ text: 'OK', onPress: this.onUnsuccessfulLoginAlertAckowledged }],
{ cancelable: false },
);
- } else if (messageForException === 'Unsupported version') {
+ } else if (
+ messageForException === 'Unsupported version' ||
+ messageForException === 'client_version_unsupported'
+ ) {
Alert.alert(
appOutOfDateAlertDetails.title,
appOutOfDateAlertDetails.message,
diff --git a/native/account/registration/existing-ethereum-account.react.js b/native/account/registration/existing-ethereum-account.react.js
--- a/native/account/registration/existing-ethereum-account.react.js
+++ b/native/account/registration/existing-ethereum-account.react.js
@@ -29,7 +29,10 @@
ScreenParamList,
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
-import { unknownErrorAlertDetails } from '../../utils/alert-messages.js';
+import {
+ unknownErrorAlertDetails,
+ appOutOfDateAlertDetails,
+} from '../../utils/alert-messages.js';
import Alert from '../../utils/alert.js';
import { useLegacySIWEServerCall } from '../siwe-hooks.js';
@@ -92,6 +95,16 @@
cancelable: false,
},
);
+ } else if (
+ messageForException === 'Unsupported version' ||
+ messageForException === 'client_version_unsupported'
+ ) {
+ Alert.alert(
+ appOutOfDateAlertDetails.title,
+ appOutOfDateAlertDetails.message,
+ [{ text: 'OK', onPress: goBackToHome }],
+ { cancelable: false },
+ );
} else {
Alert.alert(
unknownErrorAlertDetails.title,

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 2, 6:34 AM (21 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2215479
Default Alt Text
D12082.diff (4 KB)

Event Timeline