Skip to content

Commit d938139

Browse files
fix(overmind): only allow mutations when possible
1 parent be84911 commit d938139

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/node_modules/overmind/src/statemachine.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class StateMachine<States extends TStates, State extends TStates = States> {
5050
matches(state) {
5151
if (state === this.state) {
5252
const tree = (this[PROXY_TREE].master.mutationTree || this[PROXY_TREE])
53-
tree.enableMutations()
53+
// Might be used outside of action
54+
tree.enableMutations && tree.enableMutations()
5455
return true
5556
}
5657

0 commit comments

Comments
 (0)