Skip to content

Fix 9906 - Prevent unwanted 'no quotes available' message when going back to build quote screen while having insufficient funds#9994

Merged
darkwing merged 1 commit intoMetaMask:developfrom
darkwing:fix-9906-2
Dec 7, 2020
Merged

Fix 9906 - Prevent unwanted 'no quotes available' message when going back to build quote screen while having insufficient funds#9994
darkwing merged 1 commit intoMetaMask:developfrom
darkwing:fix-9906-2

Conversation

@darkwing
Copy link
Copy Markdown
Contributor

@darkwing darkwing commented Dec 3, 2020

Supercedes #9958

Fixes: #9906

Explanation:

This bug took me in a million places but in the end, I found that this call to resetSwapsPostFetchState appears to do absolutely nothing with regard to changing the state, but what it does do is redirect the user back to the "build quote" screen, thus negating the need for history.push(BUILD_QUOTE_ROUTE) and causing our timing conflict.

Manual testing steps:

  • Create a swap where you have an insufficient balance.
  • When swap view comes up, click "Back" in the footer
  • Change nothing, click "Swap" again
  • Before this PR, the swap would show "No quotes available" error; with this PR applied, the swap view should display again.

…back to build quote screen while having insufficient funds
@darkwing darkwing requested a review from a team as a code owner December 3, 2020 20:39
@darkwing darkwing requested review from NiranjanaBinoy and danjm and removed request for NiranjanaBinoy December 3, 2020 20:39
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 3, 2020

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.

@danjm
Copy link
Copy Markdown
Contributor

danjm commented Dec 7, 2020

This PR is safe because resetSwapsPostFetchState is already called on mount of the build-quote component

@danjm
Copy link
Copy Markdown
Contributor

danjm commented Dec 7, 2020

Confirmed that it fixes #9906

@darkwing darkwing merged commit 5fd6d1a into MetaMask:develop Dec 7, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2020
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.

Bug: swaps shows no quotes available when trying to get quotes after first viewing a quote you can't afford

2 participants