Fix double undos, cleans up utils

This commit is contained in:
Steve Ruiz 2021-06-24 13:34:43 +01:00
parent 8271e6d431
commit bdafae3db6
53 changed files with 1676 additions and 1515 deletions

View file

@ -18,9 +18,9 @@ export default function arrowCommand(
do(data, isInitial) {
if (isInitial) return
const { initialShape, currentPageId } = after
const { initialShape } = after
const page = getPage(data, currentPageId)
const page = getPage(data)
page.shapes[initialShape.id] = initialShape
@ -31,8 +31,8 @@ export default function arrowCommand(
data.pointedId = undefined
},
undo(data) {
const { initialShape, currentPageId } = before
const shapes = getPage(data, currentPageId).shapes
const { initialShape } = before
const shapes = getPage(data).shapes
delete shapes[initialShape.id]