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

Make computed properties reactive to document.web3network changes #7473

Merged
merged 2 commits into from
Sep 19, 2020

Conversation

mds1
Copy link
Contributor

@mds1 mds1 commented Sep 19, 2020

Problem

The list of supported zkSync tokens is stored as a computed property called zkSyncSupportedTokens. It's dependent on document.web3network. Vue cannot react to changes in document, so when the network changed this was not updated.

This means if a user visits the cart, then connects their wallet, the network change would not be detected, and zkSyncSupportedTokens would return an empty list. As a result, they would not be able to checkout with zkSync.

Solution

We fix this by adding a new property to the component. Vue can watch and react to changes in this new property, and we update this new property when the dataWalletReady event is detected. We also make the mainnet token list the default when nothing is detected

cc @octavioamu @thelostone-mc

@mds1
Copy link
Contributor Author

mds1 commented Sep 19, 2020

I also added a commit to add SNT support here since that was recently added by zkSync

@owocki owocki merged commit 487d709 into gitcoinco:stable Sep 19, 2020
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