-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 activeTabUrl #2005
Fix activeTabUrl #2005
Conversation
@@ -549,6 +555,7 @@ class ApproveTransactionReview extends PureComponent { | |||
primaryCurrency, | |||
currentCurrency, | |||
gasError, | |||
activeTabUrl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were still trying to get it from component state instead of props
@@ -10,7 +10,7 @@ exports[`ApproveTransactionModal should render correctly 1`] = ` | |||
} | |||
} | |||
accountsLength={1} | |||
activeTabUrl="" | |||
activeTabUrl="https://metamask.github.io/test-dapp/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests!
@@ -143,7 +143,7 @@ const TransactionHeader = props => { | |||
let title = ''; | |||
if (originIsDeeplink) title = renderShortAddress(spenderAddress); | |||
else if (originIsWalletConnect) title = getHost(origin.split(WALLET_CONNECT_ORIGIN)[1]); | |||
else title = getHost(currentEnsName || url); | |||
else title = getHost(currentEnsName || url || origin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we fall back to origin
, but it's not really necessary (better than potentially showing undefined
if this ever breaks again)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA Passed 👍
* Fix transaction header title * Get activeTabUrl from props now * Update tests * Update CHANGELOG * bump * fixwcicon Co-authored-by: Esteban Mino <efmino@uc.cl>
Description
Right now there's an issue in the
TransactionHeader
component where theurl
prop that's being passed isundefined
:This fixes that:
There might be a better fix? Maybe this component could use a refactor where it no longer requires asurl
prop? For now I think this is a good defensive patch.Checklist
Issue
Resolves #???