Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3399216
D12123.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12123.diff
View Options
diff --git a/native/qr-code/qr-code-screen.react.js b/native/qr-code/qr-code-screen.react.js
--- a/native/qr-code/qr-code-screen.react.js
+++ b/native/qr-code/qr-code-screen.react.js
@@ -11,6 +11,7 @@
import { useTunnelbroker } from 'lib/tunnelbroker/tunnelbroker-context.js';
import type { BackupKeys } from 'lib/types/backup-types.js';
import { getContentSigningKey } from 'lib/utils/crypto-utils.js';
+import { getMessageForException } from 'lib/utils/errors.js';
import type { QRCodeSignInNavigationProp } from './qr-code-sign-in-navigator.react.js';
import {
@@ -21,6 +22,10 @@
import type { NavigationRoute } from '../navigation/route-names.js';
import { useStyles } from '../themes/colors.js';
import * as AES from '../utils/aes-crypto-module.js';
+import {
+ appOutOfDateAlertDetails,
+ unknownErrorAlertDetails,
+} from '../utils/alert-messages.js';
import Alert from '../utils/alert.js';
type QRCodeScreenProps = {
@@ -65,9 +70,21 @@
await logInSecondaryDevice(userID);
} catch (err) {
console.error('Secondary device registration error:', err);
- Alert.alert('Registration failed', 'Failed to upload device keys', [
- { text: 'OK' },
- ]);
+ const messageForException = getMessageForException(err);
+ if (
+ messageForException === 'client_version_unsupported' ||
+ messageForException === 'Unsupported version'
+ ) {
+ Alert.alert(
+ appOutOfDateAlertDetails.title,
+ appOutOfDateAlertDetails.message,
+ );
+ } else {
+ Alert.alert(
+ unknownErrorAlertDetails.title,
+ unknownErrorAlertDetails.message,
+ );
+ }
void generateQRCode();
}
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 2:26 AM (19 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609806
Default Alt Text
D12123.diff (1 KB)
Attached To
Mode
D12123: [native] Handle outdated client error in QR code auth flow
Attached
Detach File
Event Timeline
Log In to Comment