Skip to content

Commit

Permalink
🐛 disable undo
Browse files Browse the repository at this point in the history
  • Loading branch information
FurryR committed Jan 21, 2024
1 parent f3f0364 commit 647a9eb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ declare let Scratch: ScratchContext
| undefined
)?.ScratchBlocks
}
if (this.Blockly) {
console.groupCollapsed(
'❗ Undo/Redo feature is disabled in order to avoid undo bug.'
)
console.log(
'🔗 Reference: https://github.com/FurryR/lpp-scratch/issues/1'
)
console.groupEnd()
;(
this.Blockly.Events as unknown as { recordUndo: boolean }
).recordUndo = false
}
// Ignore SAY and QUESTION calls on dummy target.
const _emit = this.runtime.emit
this.runtime.emit = (event: string, ...args: unknown[]): void => {
Expand Down

0 comments on commit 647a9eb

Please sign in to comment.