From 08b0136404bc631f895e02a67405c3bf9053abb4 Mon Sep 17 00:00:00 2001 From: Derek Brans Date: Tue, 25 Jun 2024 08:34:44 -0400 Subject: [PATCH 1/3] disable protect modal in development --- app/components/UI/DrawerView/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/components/UI/DrawerView/index.js b/app/components/UI/DrawerView/index.js index 82963e61ae0..ae128a00f2f 100644 --- a/app/components/UI/DrawerView/index.js +++ b/app/components/UI/DrawerView/index.js @@ -949,6 +949,11 @@ class DrawerView extends PureComponent { }; renderProtectModal = () => { + const NODE_ENV = 'NODE_ENV'; + if (process.env[NODE_ENV] === 'development') { + return null; + } + const colors = this.context.colors || mockTheme.colors; const styles = createStyles(colors); From ff400ca5d7e32c8e41e60fd7fd9c09e0222d2a2f Mon Sep 17 00:00:00 2001 From: Derek Brans Date: Tue, 25 Jun 2024 08:54:29 -0400 Subject: [PATCH 2/3] create isDevelopment function --- app/components/UI/DrawerView/index.js | 4 ++-- app/util/env.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 app/util/env.ts diff --git a/app/components/UI/DrawerView/index.js b/app/components/UI/DrawerView/index.js index ae128a00f2f..e75c8474937 100644 --- a/app/components/UI/DrawerView/index.js +++ b/app/components/UI/DrawerView/index.js @@ -87,6 +87,7 @@ import { selectSelectedInternalAccountChecksummedAddress } from '../../../select import { createAccountSelectorNavDetails } from '../../Views/AccountSelector'; import NetworkInfo from '../NetworkInfo'; import { withMetricsAwareness } from '../../../components/hooks/useMetrics'; +import { isDevelopment } from 'app/util/env'; const createStyles = (colors) => StyleSheet.create({ @@ -949,8 +950,7 @@ class DrawerView extends PureComponent { }; renderProtectModal = () => { - const NODE_ENV = 'NODE_ENV'; - if (process.env[NODE_ENV] === 'development') { + if (isDevelopment()) { return null; } diff --git a/app/util/env.ts b/app/util/env.ts new file mode 100644 index 00000000000..0645efedd8c --- /dev/null +++ b/app/util/env.ts @@ -0,0 +1,4 @@ +const NODE_ENV = 'NODE_ENV'; + +// eslint-disable-next-line import/prefer-default-export +export const isDevelopment = () => process.env[NODE_ENV] === 'development'; From 7fbada6150986ec21a84aed11fc39f6b25fa9846 Mon Sep 17 00:00:00 2001 From: Derek Brans Date: Tue, 25 Jun 2024 10:21:07 -0400 Subject: [PATCH 3/3] fix import --- app/components/UI/DrawerView/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/UI/DrawerView/index.js b/app/components/UI/DrawerView/index.js index e75c8474937..174831caa59 100644 --- a/app/components/UI/DrawerView/index.js +++ b/app/components/UI/DrawerView/index.js @@ -87,7 +87,7 @@ import { selectSelectedInternalAccountChecksummedAddress } from '../../../select import { createAccountSelectorNavDetails } from '../../Views/AccountSelector'; import NetworkInfo from '../NetworkInfo'; import { withMetricsAwareness } from '../../../components/hooks/useMetrics'; -import { isDevelopment } from 'app/util/env'; +import { isDevelopment } from '../../../util/env'; const createStyles = (colors) => StyleSheet.create({