-
Notifications
You must be signed in to change notification settings - Fork 101
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: prevent adding unsupported hooks for your wallet #5020
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const { name, image, descriptionShort } = dapp | ||
|
||
const isCompatible = |
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.
The code is duplicated in HookListItem
component, I suggest to move it in a util function
<HookListItem | ||
key={isHookDappIframe(dapp) ? dapp.url : dapp.name} | ||
dapp={dapp} | ||
onRemove={isAllHooksTab ? undefined : () => removeCustomHookDapp(dapp as HookDappIframe)} | ||
walletType={ |
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.
walletType={walletType}
const isCompatible = (dapp: HookDapp) => | ||
!dapp.conditions?.walletCompatibility || dapp.conditions.walletCompatibility.includes(walletType) | ||
return filteredDapps.sort((a, b) => (isCompatible(a) === isCompatible(b) ? 0 : isCompatible(a) ? -1 : 1)) | ||
}, [filteredDapps, isSmartContractWallet]) |
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.
walletType
is not present in useMemo()
deps
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.
And isSmartContractWallet
is not needed there
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.
Hey @fairlighteth , great, thank you!
However, in this PR it is impossible to add a custom hook even if a wallet type is allowed for it.
Please see #4910 : you can find there instructions how to get a custom hook link.
@elena-zh address your comment, should work as expected now: |
@shoom3301 addressed your comments and did some refactoring in general. |
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.
Works now, thank you!
Summary
EOA connected:
Safe connected:
Screen.Recording.2024-10-22.at.16.48.46.mov