Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #7759: Send token view default token #7763

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

StephenHeaps
Copy link
Contributor

Summary of Changes

  • Send was picking a random token for the currently selected network after the Migrate User Assets from BraveCore to CoreData change because core data returns the models in a non-deterministic order and we were just selecting the first token.
  • Logic is updated to now try and select the current networks default token, fallback to BAT, with fallback to the first visible asset when sorted by name.
  • Additionally, we are now presenting Select a Token to Send modal when you first open Send view.

This pull request fixes #7759

Submitter Checklist:

  • Unit Tests are updated to cover new or changed functionality
  • User-facing strings use NSLocalizableString()
  • New or updated UI has been tested across:
    • Light & dark mode
    • Different size classes (iPhone, landscape, iPad)
    • Different dynamic type sizes

Test Plan:

  1. Have at least 2 tokens on a single network as visible assets (ex. SOL & USDC on Solana Mainnet).
  2. Open Buy/Swap and change network to the network with 2 or more visible assets, then close Buy/Swap.
  3. Open Send.
  4. Verify Select Token to Send automatically presents.
  5. Without selecting a token, press Cancel or swipe to dismiss.
  6. Verify the selected token is the native asset on network.
  7. Close Send & repeat test from step 3 a couple times. Verify the same token is selected by default.

Screenshots:

7759.mp4

Reviewer Checklist:

  • Issues include necessary QA labels:
    • QA/(Yes|No)
    • bug / enhancement
  • Necessary security reviews have taken place.
  • Adequate unit test coverage exists to prevent regressions.
  • Adequate test plan exists for QA to validate (if applicable).
  • Issue and pull request is assigned to a milestone (should happen at merge time).

@StephenHeaps StephenHeaps added this to the 1.56 milestone Jul 20, 2023
@StephenHeaps StephenHeaps requested a review from nuo-xu July 20, 2023 19:42
@StephenHeaps StephenHeaps requested a review from a team as a code owner July 20, 2023 19:42
@StephenHeaps StephenHeaps self-assigned this Jul 20, 2023
@StephenHeaps StephenHeaps merged commit 4aaecd7 into development Jul 21, 2023
@StephenHeaps StephenHeaps deleted the wallet/send-default-token branch July 21, 2023 18:00
StephenHeaps added a commit that referenced this pull request Jul 21, 2023
* Select the native asset by default, fallback to BAT token, fallback to first visible user token (sorted alphabetically)

* Auto-present Select Token to Send view when opening Send.
arthuredelstein pushed a commit to brave/brave-core that referenced this pull request Feb 13, 2024
…ios#7763)

* Select the native asset by default, fallback to BAT token, fallback to first visible user token (sorted alphabetically)

* Auto-present Select Token to Send view when opening Send.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send screen always shows a different token as default selected token
3 participants