Skip to content

Commit 1433dc0

Browse files
Merge pull request cerebral#163 from cerebral/devtoolsLocalhost
feat(overmind): autoconnect to devtools only on localhost
2 parents 441e72f + e53a93a commit 1433dc0

File tree

2 files changed

+12
-3
lines changed
  • packages

2 files changed

+12
-3
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,18 @@ export class Overmind<Config extends Configuration> implements Configuration {
103103
The action factory function
104104
*/
105105

106-
if (options.devtools !== false && typeof window !== 'undefined') {
107-
this.initializeDevtools(options.devtools, eventHub, proxyStateTree)
106+
if (
107+
!IS_PRODUCTION &&
108+
options.devtools !== false &&
109+
typeof window !== 'undefined'
110+
) {
111+
if (location.hostname === 'localhost' || options.devtools) {
112+
this.initializeDevtools(options.devtools, eventHub, proxyStateTree)
113+
} else {
114+
console.warn(
115+
'OVERMIND: You are running in development mode, but not on localhost. You will have to manually define the devtools option to connect'
116+
)
117+
}
108118
}
109119

110120
this.initializeReactions(configuration, eventHub, proxyStateTree)

packages/overmind-website/src/components/Guide/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const Guide: Component = () => {
2929
}, [])
3030

3131
if (!content) {
32-
console.log('null')
3332
return null
3433
}
3534

0 commit comments

Comments
 (0)