yam-finance / synths-www

YAM Synths.
https://synthsv3.yam.xyz
MIT License
3 stars 3 forks source link

Fix metamask bug, if user has just connected to metamask but there are no addresses initialized on the metamask extension, it will break the page #149

Open ethedev opened 2 years ago

ethedev commented 2 years ago

On the case where the request type to metamask is wallet_requestPermissions the website must wait and not break (header and footer disappearing) for when metamask sends back a response, then on connection success the address should just be loaded in.

inpage.js:1 MetaMask - RPC Error: Request of type 'wallet_requestPermissions' already pending for origin https://deploy-preview-158--modest-leavitt-3a2875.netlify.app. Please wait. Object
ghost commented 2 years ago

Hm.. so it allows you to connect to the dapp even if you have not created an account on metamask and just installed the extension?

ethedev commented 2 years ago

correct

ethedev commented 2 years ago

additional errors might show:

vendor.cb1e225a.js:6 TypeError: Cannot read properties of null (reading 'slice')
    at L (AppView.086a48ec.js:6)
    at Proxy.<anonymous> (AppView.086a48ec.js:6)
    at Pd (vendor.cb1e225a.js:6)
    at yd.W [as fn] (vendor.cb1e225a.js:6)
    at yd.run (vendor.cb1e225a.js:6)
    at c5 (vendor.cb1e225a.js:6)
    at G_ (vendor.cb1e225a.js:6)
U$ @ vendor.cb1e225a.js:6
vendor.cb1e225a.js:6 TypeError: Cannot read properties of null (reading 'slice')
    at h (AppView.086a48ec.js:6)
    at Proxy.<anonymous> (AppView.086a48ec.js:6)
    at Pd (vendor.cb1e225a.js:6)
    at yd.W [as fn] (vendor.cb1e225a.js:6)
    at yd.run (vendor.cb1e225a.js:6)
    at c5 (vendor.cb1e225a.js:6)
    at G_ (vendor.cb1e225a.js:6)