-
Notifications
You must be signed in to change notification settings - Fork 197
feat: fix expo example #1972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fix expo example #1972
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
How to use the Graphite Merge QueueAdd the label graphite-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
🌿 Documentation Preview
|
onPress={() => { | ||
signer | ||
.authenticate({ | ||
phone, | ||
type: "sms", | ||
}) | ||
.catch(console.error); | ||
setAwaitingOtp(true); | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a potential race condition in the authentication flow. Currently, setAwaitingOtp(true)
is executed immediately after initiating the async authenticate()
call, without waiting for its completion. If the authentication request fails, the UI will still transition to the OTP input screen even though no OTP was actually sent.
Consider moving the state update inside a success callback or adding error handling to reset the state:
onPress={() => {
signer
.authenticate({
phone,
type: "sms",
})
.then(() => {
setAwaitingOtp(true);
})
.catch((error) => {
console.error(error);
// Optionally show an error message to the user
});
}}
This ensures the UI state accurately reflects the authentication process status.
onPress={() => { | |
signer | |
.authenticate({ | |
phone, | |
type: "sms", | |
}) | |
.catch(console.error); | |
setAwaitingOtp(true); | |
}} | |
onPress={() => { | |
signer | |
.authenticate({ | |
phone, | |
type: "sms", | |
}) | |
.then(() => { | |
setAwaitingOtp(true); | |
}) | |
.catch((error) => { | |
console.error(error); | |
// Optionally show an error message to the user | |
}); | |
}} |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
c12e792
to
c88849a
Compare
c88849a
to
9016c1b
Compare
* feat: working version * feat: working version * chore: remove sms auth * feat: regenerate with old lockfile, remove expo-doctor * chore: update lockfile & remove embedded-accounts-quickstart --------- Co-authored-by: jakehobbs <jacob.hobbs@alchemy.com>
Pull Request Checklist
yarn test
)site
folder, and guidelines for updating/adding docs can be found in the contribution guide)feat!: breaking change
)yarn lint:check
) and fix any issues? (yarn lint:write
)PR-Codex overview
This PR focuses on updating dependencies, enhancing configuration files, and making adjustments to the project structure for a React Native application.
Detailed summary
react-native-config
,@react-native-community/cli
, and added@react-navigation/elements
.metro.config.js
to handle.js
/.jsx
extensions in TypeScript files.package.json
dependencies, including updates toexpo
,react-native
, andreact-native-screens
.Podfile.lock
to reflect new versions for various pods.project.pbxproj
to include new files and update existing ones.