Skip to content
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

Merged
merged 6 commits into from
Apr 29, 2022
Merged

🔧 Fix local mocks #2940

merged 6 commits into from
Apr 29, 2022

Conversation

RafalPloszka
Copy link
Contributor

@RafalPloszka RafalPloszka commented Apr 29, 2022

@vercel
Copy link

vercel bot commented Apr 29, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
dao ✅ Ready (Inspect) Visit Preview Apr 29, 2022 at 3:32PM (UTC)
pioneer-2 ✅ Ready (Inspect) Visit Preview Apr 29, 2022 at 3:32PM (UTC)
pioneer-2-storybook ✅ Ready (Inspect) Visit Preview Apr 29, 2022 at 3:32PM (UTC)

Copy link
Collaborator

@thesan thesan left a 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
Copy link
Collaborator

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] : []),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this should work:

Suggested change
...(IS_IN_DEV_ENVIRONMENT ? ['local-mocks' as const] : []),
...(IS_DEVELOPMENT ? ['local-mocks' as const] : []),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants