-
Notifications
You must be signed in to change notification settings - Fork 71
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 local mocks #2940
🔧 Fix local mocks #2940
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Nice job the local-mocks
is back 🚀. I just fixed the logic to hide it in production mode. And the test to check that it doesn't break again can be added in a follow-up PR
@@ -11,13 +11,16 @@ const OLYMPIA_TESTNET_NODE_SOCKET = process.env.REACT_APP_OLYMPIA_TESTNET_NODE_S | |||
const OLYMPIA_TESTNET_QUERY_NODE = process.env.REACT_APP_OLYMPIA_TESTNET_QUERY_NODE | |||
const OLYMPIA_TESTNET_QUERY_NODE_SOCKET = process.env.REACT_APP_OLYMPIA_TESTNET_QUERY_NODE_SOCKET | |||
const OLYMPIA_TESTNET_MEMBERSHIP_FAUCET_URL = process.env.REACT_APP_OLYMPIA_TESTNET_MEMBERSHIP_FAUCET_URL | |||
const ENVIRONMENT = process.env.ENVIRONMENT |
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.
ATM process.env.ENVIRONMENT
is not passed to the client by Webpack but there is a global IS_DEVELOPMENT
which is true
in development env.
@@ -12,7 +12,7 @@ export const useNetwork = () => { | |||
const networks = useMemo<NetworkType[]>( | |||
() => [ | |||
'local', | |||
'local-mocks', | |||
...(IS_IN_DEV_ENVIRONMENT ? ['local-mocks' as const] : []), |
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.
So this should work:
...(IS_IN_DEV_ENVIRONMENT ? ['local-mocks' as const] : []), | |
...(IS_DEVELOPMENT ? ['local-mocks' as const] : []), |
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.
Nice, thanks
#2893