Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3382286
D12083.id40326.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D12083.id40326.diff
View Options
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
@@ -135,6 +135,7 @@
avatarData: null,
clearCachedSelections: () => {},
onNonceExpired: () => onNonceExpired('registration'),
+ onAlertAcknowledged: goBackToPrompt,
});
} catch {
// We swallow exceptions here because registrationServerCall
diff --git a/native/account/registration/registration-server-call.js b/native/account/registration/registration-server-call.js
--- a/native/account/registration/registration-server-call.js
+++ b/native/account/registration/registration-server-call.js
@@ -69,6 +69,7 @@
| {
+step: 'identity_registration_dispatched',
+clearCachedSelections: () => void,
+ +onAlertAcknowledged: ?() => mixed,
+avatarData: ?AvatarData,
+credentialsToSave: ?{ +username: string, +password: string },
+resolve: () => void,
@@ -103,6 +104,7 @@
async (
accountSelection: UsernameAccountSelection,
farcasterID: ?string,
+ onAlertAcknowledged: ?() => mixed,
) => {
const identityRegisterPromise = (async () => {
try {
@@ -116,21 +118,29 @@
Alert.alert(
usernameReservedAlertDetails.title,
usernameReservedAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
} else if (e.message === 'username already exists') {
Alert.alert(
usernameTakenAlertDetails.title,
usernameTakenAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
} else if (e.message === 'Unsupported version') {
Alert.alert(
appOutOfDateAlertDetails.title,
appOutOfDateAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
} else {
Alert.alert(
unknownErrorAlertDetails.title,
unknownErrorAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
}
throw e;
@@ -149,6 +159,7 @@
async (
accountSelection: UsernameAccountSelection,
keyserverURL: string,
+ onAlertAcknowledged: ?() => mixed,
) => {
const extraInfo = await legacyLogInExtraInfo();
const legacyKeyserverRegisterPromise = (async () => {
@@ -168,21 +179,29 @@
Alert.alert(
usernameReservedAlertDetails.title,
usernameReservedAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
} else if (e.message === 'username_taken') {
Alert.alert(
usernameTakenAlertDetails.title,
usernameTakenAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
} else if (e.message === 'client_version_unsupported') {
Alert.alert(
appOutOfDateAlertDetails.title,
appOutOfDateAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
} else {
Alert.alert(
unknownErrorAlertDetails.title,
unknownErrorAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
}
throw e;
@@ -221,6 +240,7 @@
siweBackupSecrets,
clearCachedSelections,
onNonceExpired,
+ onAlertAcknowledged,
} = input;
const keyserverURL = passedKeyserverURL ?? defaultURLPrefix;
if (
@@ -230,11 +250,13 @@
await legacyKeyserverRegisterUsernameAccount(
accountSelection,
keyserverURL,
+ onAlertAcknowledged,
);
} else if (accountSelection.accountType === 'username') {
await identityRegisterUsernameAccount(
accountSelection,
farcasterID,
+ onAlertAcknowledged,
);
} else if (!usingCommServicesAccessToken) {
try {
@@ -245,6 +267,8 @@
Alert.alert(
unknownErrorAlertDetails.title,
unknownErrorAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
throw e;
}
@@ -264,6 +288,8 @@
Alert.alert(
unknownErrorAlertDetails.title,
unknownErrorAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
}
throw e;
@@ -299,6 +325,7 @@
step: 'identity_registration_dispatched',
avatarData,
clearCachedSelections,
+ onAlertAcknowledged,
credentialsToSave,
resolve,
reject,
@@ -356,6 +383,7 @@
const {
avatarData,
clearCachedSelections,
+ onAlertAcknowledged,
credentialsToSave,
resolve,
reject,
@@ -385,6 +413,8 @@
Alert.alert(
unknownErrorAlertDetails.title,
unknownErrorAlertDetails.message,
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
return deletionResult;
} catch (deleteException) {
@@ -393,6 +423,8 @@
'We were able to create your account, but were unable to log ' +
'you in. Try going back to the login screen and logging in ' +
'with your new credentials.',
+ [{ text: 'OK', onPress: onAlertAcknowledged }],
+ { cancelable: !onAlertAcknowledged },
);
throw deleteException;
}
diff --git a/native/account/registration/registration-types.js b/native/account/registration/registration-types.js
--- a/native/account/registration/registration-types.js
+++ b/native/account/registration/registration-types.js
@@ -46,6 +46,7 @@
+siweBackupSecrets?: ?SIWEBackupSecrets,
+clearCachedSelections: () => void,
+onNonceExpired: () => mixed,
+ +onAlertAcknowledged?: () => mixed,
};
export type CachedUserSelections = {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 9:39 AM (20 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596586
Default Alt Text
D12083.id40326.diff (7 KB)
Attached To
Mode
D12083: [native] Call goBackToPrompt when registration fails in FullscreenSIWEPanel
Attached
Detach File
Event Timeline
Log In to Comment