-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the behavior of the cached undo/redo stack #51644
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,7 +263,7 @@ export function useEntityBlockEditor( kind, name, { id: _id } = {} ) { | |
|
||
registry.batch( () => { | ||
updateFootnotes( edits.blocks ); | ||
editEntityRecord( kind, name, id, edits ); | ||
editEntityRecord( kind, name, id, edits, { isCached: false } ); | ||
} ); | ||
}, | ||
[ kind, name, id, blocks, updateFootnotes ] | ||
|
@@ -275,7 +275,7 @@ export function useEntityBlockEditor( kind, name, { id: _id } = {} ) { | |
const edits = { blocks: newBlocks, selection }; | ||
registry.batch( () => { | ||
updateFootnotes( edits.blocks ); | ||
editEntityRecord( kind, name, id, edits ); | ||
editEntityRecord( kind, name, id, edits, { isCached: false } ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @youknowriad I rebase this PR to try it with footnotes, but undo still doesn't seem batched. Do we need to update the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That change is not correct. For this PR to only create one undo level for footnotes, you need one of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, sorry. I just rebased with the previous change. |
||
} ); | ||
}, | ||
[ kind, name, id, updateFootnotes ] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that example!