Mark an undo before toggling lock (#1969)

This PR adds a history mark before toggling locked.

### Change Type

- [x] `patch` — Bug fix

### Test Plan

1. Create a shape.
2. Use the menu or a shortcut to toggle locked.
3. Undo.
4. The locked should undo but the shape should still be there.

### Release Notes

- Mark an undo before toggling locked.
This commit is contained in:
Steve Ruiz 2023-09-29 12:04:06 +01:00 committed by GitHub
parent 56e5bfdd71
commit 230212028f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1082,6 +1082,7 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
readonlyOk: false, readonlyOk: false,
kbd: '!l', kbd: '!l',
onSelect(source) { onSelect(source) {
editor.mark('locking')
trackEvent('toggle-lock', { source }) trackEvent('toggle-lock', { source })
editor.toggleLock(editor.selectedShapeIds) editor.toggleLock(editor.selectedShapeIds)
}, },