Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Show error notifications #439

Closed ferostabio closed 1 year ago

github-actions[bot] commented 1 year ago

Please test this PR on: https://v2-staging-439-dot-fuji-306908.ey.r.appspot.com

brozorec commented 1 year ago
  1. When I disconnected manually from MM, I got this error thrown image
  2. I'm disconnected, I go to the markets page and select a vault on Arbitrum. I'm redirected to the borrow page, I click "Connect Wallet" and got this. In the meantime, the deposit and the borrow chains were changed to Polygon. image
  3. I'm connected with an address with an existing position on Arbitrum, my wallet chain is Arbitrum and I start from the borrow page. Getting again the same error (about the 3-chain transfers) and don't have the warning message for the existing position.
  4. Happening the same when I click on the max button in the collateral input.

    In the cases above, there's no reason for the 3-chain error to happen. I suppose we are doing unnecessary calls to the SDK with inputs that are not wanted by the user (fighting with the initial values maybe?)

ferostabio commented 1 year ago
  1. When I disconnected manually from MM, I got this error thrown image

I tested this a lot a couple of weeks ago -it never crashed. I'm guessing the latest MM upgrade broke things.

ferostabio commented 1 year ago

I tested this a lot a couple of weeks ago -it never crashed. I'm guessing the latest MM upgrade broke things.

Turns out it is @web3-onboard/core the one that's crashing. When the wallet is disconnected, a subscription is triggered and the following line crashes because wallets is an empty array [].

const { accounts } = wallets.find(wallet => wallet.label === label);