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: wrong behaviour of switch wallet #1646

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jdecristi
Copy link
Contributor

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
Screen.Recording.2023-06-14.at.11.06.05.PM.mov
Screen.Recording.2023-06-14.at.11.19.08.PM.mov

Author Checklist

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

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

If the PR is ready for review:

  • 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

@height
Copy link

height bot commented Jun 15, 2023

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.

@defispartan defispartan requested a review from MareskoY June 22, 2023 05:07
@github-actions
Copy link

github-actions bot commented Jun 22, 2023

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

@github-actions
Copy link

📦 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
Copy link

MareskoY
MareskoY previously approved these changes Jun 23, 2023
@Jdecristi Jdecristi force-pushed the fix-wrong-behaviour-of-switch-wallet branch from f020f5a to 7ba6453 Compare August 15, 2023 21:52
@foodaka foodaka added the Ready for Dev Review Read for frontend engineer reviews label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Passed QC Passed Ready for Dev Review Read for frontend engineer reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong behavior of switch wallet
3 participants