Skip to content
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

fix: 7702 client loading state #1319

Merged
merged 1 commit into from
Feb 3, 2025
Merged

Conversation

jakehobbs
Copy link
Member

@jakehobbs jakehobbs commented Feb 1, 2025

Checked out 7702 demo branch and found this error there whenever refreshing the page:

useSma7702Client.ts:81 Error: No orgId provided
    at AlchemySignerWebClient.value [as whoami] (base.ts:242:13)
    at AlchemyWebSigner.eval (base.ts:392:44)
    at AlchemyWebSigner.eval [as getAddress] (index.ts:32:29)
    at createSMA7702Account (semiModularAccount7702.ts:67:38)
    at createSMA7702AccountClient (sma7702.ts:71:52)
    at init (useSma7702Client.ts:48:43)
    at eval (useSma7702Client.ts:91:5)

This is due to the useSma7702Client hook trying to create the 7702 account client before the signer is fully initialized after rehydrating when the page is refreshed. This results in the 7702 components being fully broken because the client never loads.

Added a status check via useSignerStatus and the issue is resolved. Now you can refresh the page and everything works correctly.

Also added some better loading states for disabling the buttons before the client is ready.


PR-Codex overview

This PR enhances the useSma7702Client hook to include an isLoadingClient state and updates the usage of this hook in useRecurringTransactions and useMint. It also modifies the Wrapper7702 component to reflect these changes, improving loading state management across components.

Detailed summary

  • Added isLoadingClient state to useSma7702Client.
  • Updated useRecurringTransactions to destructure isLoadingClient.
  • Modified useMint to include isLoadingClient in loading checks.
  • Changed Wrapper7702 to use isLoadingClient for disabling the TransactionsCard.

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

Copy link

vercel bot commented Feb 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 2:36am
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 2:36am

Copy link
Collaborator

@linnall linnall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks for fixing this!

@jakehobbs jakehobbs merged commit 2f066b6 into adam/7702-ui-demo Feb 3, 2025
7 checks passed
@jakehobbs jakehobbs deleted the jake/7702-loading-fixes branch February 3, 2025 19:45
adamegyed pushed a commit that referenced this pull request Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants