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: import all detected tokens automatically #29357

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sahar-fehri
Copy link
Contributor

@sahar-fehri sahar-fehri commented Dec 19, 2024

Description

Now that we have most users autodetect tokens, we can make the UX even more streamlined. This PR automatically add in tokens we detect on behalf of users.

Open in GitHub Codespaces

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMASSETS-439

Manual testing steps

  1. import an account that have tokens
  2. Notice that tokens are imported automatically

Make sure the token detection is working properly:

  1. Go to settings and turn off "autodetect tokens" setting
  2. Add a new account that have tokens
  3. Notice tokens are not added unless you turn the setting back ON

Screenshots/Recordings

Before

Screen.Recording.2024-12-20.at.11.28.14.mov

After

Screen.Recording.2024-12-20.at.11.25.27.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@sahar-fehri sahar-fehri added the needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. label Dec 20, 2024
@sahar-fehri sahar-fehri marked this pull request as ready for review December 20, 2024 10:19
@sahar-fehri sahar-fehri requested a review from a team as a code owner December 20, 2024 10:19
@salimtb
Copy link
Contributor

salimtb commented Dec 20, 2024

tested with and without the feature flag on , works as expected , PR approved but you need to check the failing e2e test

salimtb
salimtb previously approved these changes Dec 20, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [eae8fbb]
Page Load Metrics (1686 ± 95 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27320401606354170
domContentLoaded14332047166620096
load14412053168619895
domInteractive278441147
backgroundConnect85217126
firstReactRender1674312211
getState473292311
initialActions00000
loadScripts10291543124516378
setupStore65513126
uiStartup159223371923211101
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 1.48 KiB (0.02%)
  • common: 0 Bytes (0.00%)


await Promise.all(importPromises);
} else {
await dispatch(addImportedTokens(detectedTokens, networkClientId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should have a check for whether there are any detected tokens. Otherwise it's doing an unnecessary call to the controller + state update on each load.

Screenshot 2024-12-20 at 11 10 56 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just changing the else to else if (detectedTokens?.length > 0) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants