Skip to content

chore: disable request permissions btn when permissions capability is not supported#4026

Merged
tomiir merged 9 commits intomainfrom
chore/disable-permissions-btn
May 6, 2025
Merged

chore: disable request permissions btn when permissions capability is not supported#4026
tomiir merged 9 commits intomainfrom
chore/disable-permissions-btn

Conversation

@KannuSingh
Copy link
Copy Markdown
Contributor

@KannuSingh KannuSingh commented Mar 17, 2025

Description

Disable request permission btn if not smart account and whitelisted email

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 17, 2025

⚠️ No Changeset found

Latest commit: 34d9649

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 17, 2025

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

Name Status Preview Comments Updated (UTC)
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2025 7:30am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2025 7:30am
12 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) May 6, 2025 7:30am
appkit-basic-ep-example ⬜️ Ignored (Inspect) May 6, 2025 7:30am
appkit-basic-example ⬜️ Ignored (Inspect) May 6, 2025 7:30am
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) May 6, 2025 7:30am
appkit-basic-up-example ⬜️ Ignored (Inspect) May 6, 2025 7:30am
appkit-ethers5-bera ⬜️ Ignored (Inspect) May 6, 2025 7:30am
appkit-nansen-demo ⬜️ Ignored (Inspect) May 6, 2025 7:30am
appkit-vue-solana ⬜️ Ignored (Inspect) May 6, 2025 7:30am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) May 6, 2025 7:30am
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview May 6, 2025 7:30am
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) May 6, 2025 7:30am
vue-wagmi-example ⬜️ Ignored (Inspect) May 6, 2025 7:30am

@KannuSingh KannuSingh marked this pull request as ready for review March 17, 2025 12:12
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 17, 2025

Warnings
⚠️ File apps/laboratory/app/library/wagmi-permissions-async/page.tsx contains a KEY or SECRET
⚠️ File apps/laboratory/app/library/wagmi-permissions-sync/page.tsx contains a KEY or SECRET
⚠️ File apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsAsyncTest.tsx contains a KEY or SECRET
⚠️ File apps/laboratory/src/components/Wagmi/WagmiRequestPermissionsSyncTest.tsx contains a KEY or SECRET

Generated by 🚫 dangerJS against 34d9649

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 17, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 75.93% 26336 / 34681
🔵 Statements 75.93% 26336 / 34681
🔵 Functions 67.47% 2226 / 3299
🔵 Branches 83.69% 5201 / 6214
File CoverageNo changed files found.
Generated in workflow #11571 for commit 34d9649 by the Vitest Coverage Report Action

Comment on lines +24 to +26
const isSmartAccount = accountType === 'smartAccount'
const isEmailAllowed = Boolean(user?.email?.includes('+smart-sessions@'))
const isSupported = isSmartSessionSupported() && isSmartAccount && isEmailAllowed
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

shouldn't we be doing something like

const { capabilities } = useCapabilities()

and capabilities.permissions, capabilities.sendCalls etc to enable disable the buttons?

@KannuSingh KannuSingh changed the title chore: disable permissions btn if not smart account and whitelisted email chore: disable request permissions btn when permissions capability is not supported Mar 26, 2025
@tomiir tomiir merged commit c86d704 into main May 6, 2025
38 checks passed
@tomiir tomiir deleted the chore/disable-permissions-btn branch May 6, 2025 08:09
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