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: display all available chains & check wallet VM when buying / minting nft #10720

Merged
merged 13 commits into from
Aug 22, 2024

Conversation

Jarsen136
Copy link
Contributor

@Jarsen136 Jarsen136 commented Aug 1, 2024

Thank you for your contribution to the Koda - Generative Art Marketplace.

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix

Needs QA check

  • @kodadot/qa-guild please review

Context

Display all available chains no matter what kind of wallet(SUB/EVM) you are connected to.

Did your issue had any of the "$" label on it?

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

image

@Jarsen136 Jarsen136 requested a review from a team as a code owner August 1, 2024 20:49
@Jarsen136 Jarsen136 requested review from preschian and hassnian and removed request for a team August 1, 2024 20:49
@Jarsen136 Jarsen136 changed the title fix display all available chains fix: display all available chains Aug 1, 2024
Copy link

netlify bot commented Aug 1, 2024

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 82c92a0
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/66c6ef2370e1c50007e591ed
😎 Deploy Preview https://deploy-preview-10720--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hassnian
Copy link
Contributor

hassnian commented Aug 2, 2024

changing this allows you to buy (for example) an ahp nft with a evm wallet connected

let's add this back after #10670 once multi-accounts is implemented

also @vikiival mentioned something about changing that switch to change EVMs and not chains

@hassnian
Copy link
Contributor

hassnian commented Aug 12, 2024

@jarsen can you include #10796 in this pr ? likely after #10772.

  • when the user clicks on the network with the wallet connected, display reconnect popup
  • identify edge cases when the user can cancel the connection and somehow dodge the modal

that should fix

changing this allows you to buy (for example) an ahp nft with a evm wallet connected

@exezbcz
Copy link
Member

exezbcz commented Aug 12, 2024

I mean, it does switch chains, but adds even more friction to minting a drop
image

this is me minting a base drop with a polkadot wallet connected

  • there has to be a reconnect either when switching the chain or when clicking mint

@Jarsen136
Copy link
Contributor Author

@jarsen can you include #10796 in this pr ? likely after #10772.

  • when the user clicks on the network with the wallet connected, display reconnect popup
  • identify edge cases when the user can cancel the connection and somehow dodge the modal

I've thought the same as you. We could show all available chains on the selector. Whenever the users do something on-chain operation(buy/mint), we will check if the current chain matches the wallet. If not, it will show the reconnect wallet popup modal.

It would be the easiest way to handle multiple chains. cc @exezbcz

@exezbcz
Copy link
Member

exezbcz commented Aug 12, 2024

@Jarsen136 yeah this way you are only delaying the reconnect modal to the last possible moment, i am for this. Right now there was the reconnect only when clicking the drop card

we can change it later if we realize it is not optimal

for now it will be quite aligned with the multi account thesis

@Jarsen136 Jarsen136 marked this pull request as draft August 12, 2024 10:44
@Jarsen136 Jarsen136 marked this pull request as ready for review August 12, 2024 12:42
@Jarsen136 Jarsen136 changed the title fix: display all available chains fix: display all available chains & check wallet VM when buying / minting nft Aug 12, 2024
@vikiival
Copy link
Member

cc @hassnian

hassnian
hassnian previously approved these changes Aug 14, 2024
@hassnian
Copy link
Contributor

hassnian commented Aug 14, 2024

@exezbcz s-works? anything that is missing?

(params as ExecuteSubstrateTransactionParams).cb,
arg,
{
doAfterCheckCurrentChainVM(() => {
Copy link
Contributor

@hassnian hassnian Aug 15, 2024

Choose a reason for hiding this comment

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

I get this approach but I'm not too sold on adding doAfterCheckCurrentChainVM inside useTransaction
I'd rather show the modal before the action has started.

maybe because this is simplest solution atm?

see

just a visual examaple of a case where this would run after action has started

CleanShot 2024-08-15 at 10 54 00@2x

@preschian wdyt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd rather show the modal before the action has started.

maybe because this is simplest solution atm?

Yes, it's the simplest solution, then we don't need to add this check everywhere.

although I have added checks for most cases such as mint/drop/buy, I leave it here to make sure it is impossible to do on-chain operations with an incorrect wallet.

Copy link
Contributor

@hassnian hassnian left a comment

Choose a reason for hiding this comment

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

spent some time doing qa

code has changed quite a bit, re-requesting @preschian review

@exezbcz need your input

  1. now that we have all chains, what should we do here, allow only the current vm wallet or both, same for the drop page

CleanShot 2024-08-15 at 10 25 21@2x

  1. we should remove that modal here and allow reconnect inside the drop (already working)

CleanShot 2024-08-15 at 10 30 05@2x

  1. create collection and create nft missing the switch modal
    CleanShot 2024-08-15 at 10 43 22@2x

  2. wallet connect modal selects the a defualt vm chain after the wallet is connected, pls remove that , otherwise you can do stuff like this

minting a collection on base

CleanShot.2024-08-15.at.10.44.51.mp4
  1. unrelated this pr (new issue pls) , drop page can't change prefix , it's kinda weird allowing to change the chain and changing it back
CleanShot.2024-08-15.at.10.49.31.mp4

@hassnian hassnian requested a review from preschian August 15, 2024 06:15
@Jarsen136
Copy link
Contributor Author

Jarsen136 commented Aug 15, 2024

spent some time doing qa

Thanks for taking the time to test it!

  1. now that we have all chains, what should we do here, allow only the current vm wallet or both, same for the drop page
  1. we should remove that modal here and allow reconnect inside the drop (already working)

-> 1, 2
I will wait for @exezbcz response as this is the existing interaction process.

  1. create collection and create nft missing the switch modal
  2. wallet connect modal selects the a defualt vm chain after the wallet is connected, pls remove that , otherwise you can do stuff like this

minting a collection on base

-> 3, 4

I have just fixed it.
Kapture 2024-08-15 at 10 44 40

  1. unrelated this pr (new issue pls) , drop page can't change prefix , it's kinda weird allowing to change the chain and changing it back

CleanShot.2024-08-15.at.10.49.31.mp4

will create another issue.

@preschian
Copy link
Member

spent some time doing qa

code has changed quite a bit, re-requesting @preschian review

thanks

@vikiival vikiival requested a review from hassnian August 16, 2024 10:55
@vikiival
Copy link
Member

cc @exezbcz

@exezbcz
Copy link
Member

exezbcz commented Aug 17, 2024

I've thought the same as you. We could show all available chains on the selector. Whenever the users do something on-chain operation(buy/mint), we will check if the current chain matches the wallet. If not, it will show the reconnect wallet popup modal.

yeah this sounds like it will be the easiest

for a second i though making it dynamic based on where the user currently is but that would bring even more complexity

so to answer:

  1. now that we have all chains, what should we do here, allow only the current vm wallet or both, same for the drop page

lets show both, with the "current VM tab" preselected

  • being on base and hitting connect (randomly on any page) it will show the evm tab selected
  • being on polkadot eco, it will have ahp tab selected

3. we should remove that modal here and allow reconnect inside the drop (already working)

yeah lets delay the reconnect till the last possible moment


thanks for testing @hassnian and thank you for the implementation @Jarsen136 !

@Jarsen136
Copy link
Contributor Author

so to answer:

  1. now that we have all chains, what should we do here, allow only the current vm wallet or both, same for the drop page

lets show both, with the "current VM tab" preselected

  • being on base and hitting connect (randomly on any page) it will show the evm tab selected
  • being on polkadot eco, it will have ahp tab selected
  1. we should remove that modal here and allow reconnect inside the drop (already working)

yeah lets delay the reconnect till the last possible moment

✅ Updated

image

@exezbcz
Copy link
Member

exezbcz commented Aug 21, 2024

what is left here?

can you review please @preschian ?

Copy link

@vikiival vikiival merged commit c83aa5d into kodadot:main Aug 22, 2024
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show base in wallet selector if polkadot wallet connected
5 participants