Skip to content

Commit

Permalink
adds missing async to connect docs (#5864)
Browse files Browse the repository at this point in the history
<!-- start pr-codex -->

## PR-Codex overview
This PR focuses on updating the `handleLogin` and `handlePostLogin` functions to use an `async` callback within the `connect` function, enhancing the handling of asynchronous operations in the in-app wallet connection process.

### Detailed summary
- Changed `connect(() => {...})` to `connect(async () => {...})` in multiple files.
- Updated `handlePostLogin` in `apps/portal/src/app/connect/in-app-wallet/custom-auth/configuration/page.mdx`.
- Updated `handleLogin` in various files:
  - `apps/portal/src/app/connect/in-app-wallet/guides/build-your-own-ui/page.mdx`
  - `apps/portal/src/app/react/v5/in-app-wallet/build-your-own-ui/page.mdx`
  - `apps/portal/src/app/react/v5/in-app-wallet/get-started/page.mdx`
  - Other instances in similar files.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
  • Loading branch information
nischitpra committed Dec 31, 2024
1 parent fdf3d5b commit 84d3dc4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ import { useConnect } from "thirdweb/react";
const { connect } = useConnect();

const handlePostLogin = async (jwt: string) => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import { useConnect } from "thirdweb/react";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand Down Expand Up @@ -194,7 +194,7 @@ import { inAppWallet, hasStoredPasskey } from "thirdweb/wallets/in-app";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
const hasPasskey = await hasStoredPasskey(client);
await wallet.connect({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ import { useConnect } from "thirdweb/react";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand Down Expand Up @@ -113,7 +113,7 @@ const preLogin = async (email: string) => {

const handleLogin = async (email: string, verificationCode: string) => {
// verify email and connect
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand Down Expand Up @@ -144,7 +144,7 @@ const preLogin = async (phoneNumber: string) => {

const handleLogin = async (phoneNumber: string, verificationCode: string) => {
// verify phone number and connect
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand All @@ -171,7 +171,7 @@ import { inAppWallet, hasStoredPasskey } from "thirdweb/wallets/in-app";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet({
auth: {
passkeyDomain: "example.com", // defaults to current url
Expand Down
16 changes: 8 additions & 8 deletions apps/portal/src/app/react/v5/in-app-wallet/get-started/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ import { useConnect } from "thirdweb/react";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand Down Expand Up @@ -167,7 +167,7 @@ const preLogin = async (email: string) => {

const handleLogin = async (email: string, verificationCode: string) => {
// verify email and connect
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand Down Expand Up @@ -198,7 +198,7 @@ const preLogin = async (phoneNumber: string) => {

const handleLogin = async (phoneNumber: string, verificationCode: string) => {
// verify phone number and connect
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand All @@ -225,7 +225,7 @@ import { inAppWallet, hasStoredPasskey } from "thirdweb/wallets/in-app";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet({
auth: {
passkeyDomain: "example.com", // defaults to current url
Expand Down Expand Up @@ -253,7 +253,7 @@ import { sepolia } from "thirdweb/chains";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand All @@ -276,7 +276,7 @@ import { inAppWallet } from "thirdweb/wallets/in-app";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand All @@ -302,7 +302,7 @@ import { inAppWallet } from "thirdweb/wallets/in-app";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand All @@ -324,7 +324,7 @@ import { inAppWallet } from "thirdweb/wallets/in-app";
const { connect } = useConnect();

const handleLogin = async () => {
await connect(() => {
await connect(async () => {
const wallet = inAppWallet();
await wallet.connect({
client,
Expand Down

0 comments on commit 84d3dc4

Please sign in to comment.