Skip to content

Accommodate for 0 sources verifying swap token#10521

Merged
darkwing merged 2 commits intoMetaMask:developfrom
darkwing:fix-occurance
Mar 1, 2021
Merged

Accommodate for 0 sources verifying swap token#10521
darkwing merged 2 commits intoMetaMask:developfrom
darkwing:fix-occurance

Conversation

@darkwing
Copy link
Copy Markdown
Contributor

Fixes this issue:

imagen

NotVerified

I've provided a custom message for this rare case.

@darkwing darkwing requested a review from a team as a code owner February 25, 2021 18:14
@darkwing darkwing requested review from brad-decker and danjm and removed request for brad-decker February 25, 2021 18:14
@github-actions
Copy link
Copy Markdown
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.

brad-decker
brad-decker previously approved these changes Feb 25, 2021
Gudahtt
Gudahtt previously approved these changes Feb 25, 2021
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

danjm
danjm previously approved these changes Feb 25, 2021
@darkwing darkwing dismissed stale reviews from danjm, Gudahtt, and brad-decker via de60ab1 February 25, 2021 21:56
selectedToToken?.address &&
selectedToToken?.address !== ETH_SWAPS_TOKEN_OBJECT.address;

const occurances = Number(selectedToToken?.occurances || 0);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made this small change. NaN < 2 is false, so we need to have 0 as fallback.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems a bit inappropriate to show this message before the user has selected anything though 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nothing is shown until the user does have something selected though:

EmptySwap

Maybe I'm missing something?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh I see - because toTokenIsNotEth evaluates to false in that case.

Nevermind, this all makes sense. I thought it worked differently from reading the code at first.

@darkwing darkwing merged commit 8013e85 into MetaMask:develop Mar 1, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2021
@danfinlay
Copy link
Copy Markdown
Contributor

Tbh if we're just going to link to Etherscan as "how to verify", we should just draw verifications from them directly. Might be better to just say "View on block explorer", as a way to suggest the user verifies themselves, instead of implying that presence on etherscan is equal to total verification?

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.

5 participants