fix(core): createCan command props shouldn't try dispatch (#3025) (#3026)

This commit is contained in:
Asherah Connor
2022-08-22 22:19:44 +10:00
committed by GitHub
parent 69d22d2d3c
commit 40f4ea31ef

View File

@@ -107,13 +107,13 @@ export class CommandManager {
public createCan(startTr?: Transaction): CanCommands {
const { rawCommands, state } = this
const dispatch = undefined
const dispatch = false
const tr = startTr || state.tr
const props = this.buildProps(tr, dispatch)
const formattedCommands = Object.fromEntries(Object
.entries(rawCommands)
.map(([name, command]) => {
return [name, (...args: never[]) => command(...args)({ ...props, dispatch })]
return [name, (...args: never[]) => command(...args)({ ...props, dispatch: undefined })]
})) as unknown as SingleCommands
return {