Skip to content

Commit edade14

Browse files
author
Joe Hsu
committed
check for devtools presence in statechart
1 parent 0c3722b commit edade14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/node_modules/overmind/src/config/statechart.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export function statechart<C extends IConfiguration, S extends string>(
154154
statePath.pop()
155155
}
156156

157-
if (process.env.NODE_ENV === 'development') {
157+
if (process.env.NODE_ENV === 'development' && instance.devtools) {
158158
instance.devtools.send({
159159
type: 'chart',
160160
data: {
@@ -265,7 +265,7 @@ export function statechart<C extends IConfiguration, S extends string>(
265265
traverseNewPath.pop()
266266
}
267267

268-
if (process.env.NODE_ENV === 'development') {
268+
if (process.env.NODE_ENV === 'development' && currentInstance.devtools) {
269269
currentInstance.devtools.send({
270270
type: 'chart',
271271
data: {

0 commit comments

Comments
 (0)