From 84d3dc4c42cfb22546400e30e6f36cc975cc0cdb Mon Sep 17 00:00:00 2001 From: nischitpra <20742197+nischitpra@users.noreply.github.com> Date: Tue, 31 Dec 2024 18:49:55 +0000 Subject: [PATCH] adds missing async to connect docs (#5864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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}` --- .../custom-auth/configuration/page.mdx | 2 +- .../guides/build-your-own-ui/page.mdx | 4 ++-- .../v5/in-app-wallet/build-your-own-ui/page.mdx | 8 ++++---- .../react/v5/in-app-wallet/get-started/page.mdx | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/portal/src/app/connect/in-app-wallet/custom-auth/configuration/page.mdx b/apps/portal/src/app/connect/in-app-wallet/custom-auth/configuration/page.mdx index f9c2fc1b17d..1863065d922 100644 --- a/apps/portal/src/app/connect/in-app-wallet/custom-auth/configuration/page.mdx +++ b/apps/portal/src/app/connect/in-app-wallet/custom-auth/configuration/page.mdx @@ -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, diff --git a/apps/portal/src/app/connect/in-app-wallet/guides/build-your-own-ui/page.mdx b/apps/portal/src/app/connect/in-app-wallet/guides/build-your-own-ui/page.mdx index 990a6fe4e26..0a92f9f2b86 100644 --- a/apps/portal/src/app/connect/in-app-wallet/guides/build-your-own-ui/page.mdx +++ b/apps/portal/src/app/connect/in-app-wallet/guides/build-your-own-ui/page.mdx @@ -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, @@ -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({ diff --git a/apps/portal/src/app/react/v5/in-app-wallet/build-your-own-ui/page.mdx b/apps/portal/src/app/react/v5/in-app-wallet/build-your-own-ui/page.mdx index 112a1061111..d7830849c44 100644 --- a/apps/portal/src/app/react/v5/in-app-wallet/build-your-own-ui/page.mdx +++ b/apps/portal/src/app/react/v5/in-app-wallet/build-your-own-ui/page.mdx @@ -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, @@ -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, @@ -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, @@ -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 diff --git a/apps/portal/src/app/react/v5/in-app-wallet/get-started/page.mdx b/apps/portal/src/app/react/v5/in-app-wallet/get-started/page.mdx index 89db75ae7ee..5eaada1af59 100644 --- a/apps/portal/src/app/react/v5/in-app-wallet/get-started/page.mdx +++ b/apps/portal/src/app/react/v5/in-app-wallet/get-started/page.mdx @@ -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, @@ -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, @@ -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, @@ -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 @@ -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, @@ -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, @@ -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, @@ -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,