Skip to content

Commit a64771e

Browse files
check for devtools presence in statechart (cerebral#332)
check for devtools presence in statechart
2 parents 80580d1 + edade14 commit a64771e

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
@@ -223,7 +223,7 @@ export function statechart<C extends IConfiguration>(
223223
}
224224
})
225225

226-
if (process.env.NODE_ENV === 'development') {
226+
if (process.env.NODE_ENV === 'development' && instance.devtools) {
227227
instance.devtools.send({
228228
type: 'chart',
229229
data: {
@@ -344,7 +344,7 @@ export function statechart<C extends IConfiguration>(
344344

345345
stateTarget.states = newStates
346346

347-
if (process.env.NODE_ENV === 'development') {
347+
if (process.env.NODE_ENV === 'development' && currentInstance.devtools) {
348348
currentInstance.devtools.send({
349349
type: 'chart',
350350
data: {

0 commit comments

Comments
 (0)