interface icon indicating copy to clipboard operation
interface copied to clipboard

fix: wrong behaviour of switch wallet

Open Jdecristi opened this issue 2 years ago • 4 comments

General Changes

Fixes #1208

Developer Notes

The core of the issue is when cancelling a to connect. The web3react plugin will quickly logout then log back in. I fixed this by adding a state and only updating the ui ONLY IF the user switches to a new account.

This also caused an problems when showing the error. When the web3react plugin logs back in the error disappears. This was fixed so that the error persists using useState

Logic Explanation

user opens modal & switches account -> update to the ui user opens modal & doesn't switch account -> no update to the ui user logs out -> update ui

Screen Capture

Before After

Author Checklist

Please ensure you, the author, have gone through this checklist to ensure there is an efficient workflow for the reviewers.

  • [x] The base branch is set to main
  • [x] The title is using Conventional Commit formatting
  • [x] The Github issue has been linked to the PR in the Development section
  • [x] The General Changes section has been filled out
  • [x] Developer Notes have been added (optional)

If the PR is ready for review:

  • [x] The PR is in Open state and not in Draft mode
  • [ ] The Ready for Dev Review label has been added

Reviewer Checklist

Please ensure you, as the reviewer(s), have gone through this checklist to ensure that the code changes are ready to ship safely and to help mitigate any downstream issues that may occur.

  • [ ] End-to-end tests are passing without any errors
  • [ ] Code style generally follows existing patterns
  • [ ] Code changes do not significantly increase the application bundle size
  • [ ] If there are new 3rd-party packages, they do not introduce potential security threats
  • [ ] If there are new environment variables being added, they have been added to the .env.example file as well as the pertinant .github/actions/* files
  • [ ] There are no CI changes, or they have been approved by the DevOps and Engineering team(s)
  • [ ] Code changes have been quality checked in the ephemeral URL
  • [ ] QA verification has been completed
  • [ ] There are two or more approvals from the core team
  • [ ] Squash and merge has been checked

Jdecristi avatar Jun 15 '23 03:06 Jdecristi

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

height[bot] avatar Jun 15 '23 03:06 height[bot]

✅ CI run has succeded! You can find tests and deployment logs at https://github.com/aave/interface/actions/runs/5347354302'

github-actions[bot] avatar Jun 22 '23 15:06 github-actions[bot]

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 525.81 KB (🟢 -16.7 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Thirteen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 41.03 KB (🟢 -974 B) 566.84 KB
/404 6.36 KB (🟢 -57 B) 532.17 KB
/500 6.82 KB (🟢 -58 B) 532.63 KB
/faucet 22.48 KB (🟢 -429 B) 548.29 KB
/governance 79.25 KB (🟢 -389 B) 605.06 KB
/governance/ipfs-preview 108.01 KB (🟡 +36 B) 633.82 KB
/governance/proposal 108.16 KB (🟡 +36 B) 633.97 KB
/governance/proposal/[proposalId] 62.88 KB (🟡 +37 B) 588.69 KB
/history 31.2 KB (🟢 -289 B) 557.01 KB
/markets 17.13 KB (🟢 -513 B) 542.94 KB
/reserve-overview 65.92 KB (🟢 -668 B) 591.73 KB
/staking 20.62 KB (🟢 -647 B) 546.43 KB
/v3-migration 28.85 KB (🟢 -428 B) 554.67 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

github-actions[bot] avatar Jun 22 '23 15:06 github-actions[bot]

  • Ipfs hash: bafybeihsyvn4jqmxsbutzbgqkiandngdappgitkzd57wfui6b3swmlifge
  • Ipfs preview link: https://bafybeihsyvn4jqmxsbutzbgqkiandngdappgitkzd57wfui6b3swmlifge.ipfs.cf-ipfs.com/

github-actions[bot] avatar Jun 22 '23 15:06 github-actions[bot]