-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Warn users when using Test Dapp on Mainnet #134
Conversation
Verified by QA |
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.
Looks good! Just a couple of minor requests.
src/index.js
Outdated
|
||
if (networkId === '1') { | ||
warningDiv.classList.remove('warning-invisible'); | ||
} else { | ||
warningDiv.classList.add('warning-invisible'); | ||
} |
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're trying to avoid using the networkId
as much as possible. We should move this logic to handleNewChain
and check against the chainId
instead, which will always be 0x1
for Mainnet.
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.
src/index.html
Outdated
class="error-message-icon | ||
" | ||
/> | ||
<div class="error-message-text">You are using Test Dapp on Mainnet</div> |
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.
<div class="error-message-text">You are using Test Dapp on Mainnet</div> | |
<div class="error-message-text">You are on the Ethereum Mainnet.</div> |
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.
src/index.css
Outdated
|
||
.warning-invisible { | ||
display:none; | ||
} |
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.
nit: could we add a newline at the end of the file here?
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.
src/index.css
Outdated
} | ||
|
||
.warning-invisible { | ||
display:none; |
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.
display:none; | |
display: none; |
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.
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.
LGTM!
Fixes: #56
If a user uses Test Dapp on Mainnet, a warning will be shown.
Screencast.2021-11-05.09.34.11.mp4