Skip to content

Commit

Permalink
fix: resetCanvasState indirectly called in useHistory, resets the isB…
Browse files Browse the repository at this point in the history
…lock status (#1009)
  • Loading branch information
gene9831 authored Jan 9, 2025
1 parent fee84e6 commit a834f60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/canvas/DesignCanvas/src/api/useCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ export default function () {
setSaved,
clearCanvas,
getPageSchema,
resetCanvasState,
resetPageCanvasState,
resetBlockCanvasState,
clearCurrentState,
Expand Down
3 changes: 2 additions & 1 deletion packages/toolbars/redoundo/src/composable/useHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const push = (schema) => {

const go = (addend, valid) => {
historyState.index = historyState.index + addend
useCanvas().importSchema(string2Schema(list[historyState.index]))
const { pageState, resetCanvasState } = useCanvas()
resetCanvasState({ ...pageState, pageSchema: string2Schema(list[historyState.index]) })

// 不是锁定状态,撤销操作后,传递第二个标识位,将 list 的长度减一,置灰 undoredo 操作按钮
if (typeof valid === 'boolean') {
Expand Down

0 comments on commit a834f60

Please sign in to comment.