mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[Editor] Reset the queue when a command is added after having undone all the commands
This commit is contained in:
parent
085dd0a6c5
commit
3c10c71a91
1 changed files with 5 additions and 0 deletions
|
@ -108,6 +108,11 @@ class CommandManager {
|
|||
|
||||
const save = { cmd, undo, type };
|
||||
if (this.#position === -1) {
|
||||
if (this.#commands.length > 0) {
|
||||
// All the commands have been undone and then a new one is added
|
||||
// hence we clear the queue.
|
||||
this.#commands.length = 0;
|
||||
}
|
||||
this.#position = 0;
|
||||
this.#commands.push(save);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue