-
-
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
chore: disable protect modal in development #10110
base: main
Are you sure you want to change the base?
Conversation
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. |
@@ -949,6 +949,11 @@ class DrawerView extends PureComponent { | |||
}; | |||
|
|||
renderProtectModal = () => { | |||
const NODE_ENV = 'NODE_ENV'; |
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.
Can all this be encapsulated in a util such as isDevBuild
assuming one doesn't already exist?
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.
Great idea. Done.
I don't know if it's a good idea to hide this always when it's development, we identified recently bug on that modal, if we apply this we will always miss if any bug is present during development |
Quality Gate passedIssues Measures |
@tommasini I think this could be a good improvement: default the modal to off during development. Developers who need to debug it can just comment out a line as they do now. What do you think? |
If I understood correctly you are suggesting that the default behaviour is to hide the protect modal to funded not backed up accounts. |
const NODE_ENV = 'NODE_ENV'; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export const isDevelopment = () => process.env[NODE_ENV] === 'development'; |
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.
S: we may not realy need a const on this as it's only used once and in s very specific scope (envs).
I suggest the following:
const NODE_ENV = 'NODE_ENV'; | |
// eslint-disable-next-line import/prefer-default-export | |
export const isDevelopment = () => process.env[NODE_ENV] === 'development'; | |
export const isDevelopment = () => process.env['NODE_ENV'] === 'development'; |
Also prefer default export is not a rule anymore.
If it's too onerous for devs to force this behavior, likely that's an indication it is also too arduous for many users as well? If we solve a UX regression for internal users, shouldn't we solve it for other users at the same time? Could it perhaps be toggled via "Settings" as a runtime setting, rather than as build-time configuration? |
Just going back on this, I have an idea: the issue is currently that there's no way to escape this modal an once you have it you don't have other choice than saving SRP. |
Description
This PR disables the "Protect your wallet" blocking modal when NODE_ENV is 'development'
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist