add collab commands

This commit is contained in:
Philipp Kühn
2020-12-02 09:28:55 +01:00
parent 5b794c9137
commit 143b309bdf
2 changed files with 30 additions and 11 deletions

View File

@@ -53,7 +53,9 @@ export default class CommandManager {
const method = (...args: any) => {
const callback = command(...args)(props)
view.dispatch(tr)
if (tr.steps.length) {
view.dispatch(tr)
}
return callback
}
@@ -72,7 +74,7 @@ export default class CommandManager {
return new Proxy({}, {
get: (_, name: string, proxy) => {
if (name === 'run') {
if (!hasStartTransaction && shouldDispatch) {
if (!hasStartTransaction && shouldDispatch && tr.steps.length) {
view.dispatch(tr)
}