Fix linting
This commit is contained in:
parent
c942c43ea7
commit
d4d0f5c42d
2 changed files with 21 additions and 9 deletions
|
@ -98,9 +98,11 @@ class Mutator {
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
await beforeUndo?.()
|
await beforeUndo?.()
|
||||||
|
const awaits = []
|
||||||
for (const block of blocks) {
|
for (const block of blocks) {
|
||||||
await octoClient.deleteBlock(block.id)
|
awaits.push(octoClient.deleteBlock(block.id))
|
||||||
}
|
}
|
||||||
|
await Promise.all(awaits)
|
||||||
},
|
},
|
||||||
description,
|
description,
|
||||||
this.undoGroupId,
|
this.undoGroupId,
|
||||||
|
|
|
@ -128,11 +128,16 @@ class UndoManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentGroupId = command.groupId
|
const currentGroupId = command.groupId
|
||||||
do {
|
if (currentGroupId) {
|
||||||
|
do {
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
await this.execute(command, 'undo')
|
||||||
|
this.index -= 1
|
||||||
|
command = this.commands[this.index]
|
||||||
|
} while (this.index >= 0 && currentGroupId === command.groupId)
|
||||||
|
} else {
|
||||||
await this.execute(command, 'undo')
|
await this.execute(command, 'undo')
|
||||||
this.index -= 1
|
}
|
||||||
command = this.commands[this.index]
|
|
||||||
} while (this.index >= 0 && currentGroupId && currentGroupId === command.groupId)
|
|
||||||
|
|
||||||
if (this.onStateDidChange) {
|
if (this.onStateDidChange) {
|
||||||
this.onStateDidChange()
|
this.onStateDidChange()
|
||||||
|
@ -151,11 +156,16 @@ class UndoManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentGroupId = command.groupId
|
const currentGroupId = command.groupId
|
||||||
do {
|
if (currentGroupId) {
|
||||||
|
do {
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
await this.execute(command, 'redo')
|
||||||
|
this.index += 1
|
||||||
|
command = this.commands[this.index + 1]
|
||||||
|
} while (this.index < this.commands.length - 1 && currentGroupId === command.groupId)
|
||||||
|
} else {
|
||||||
await this.execute(command, 'redo')
|
await this.execute(command, 'redo')
|
||||||
this.index += 1
|
}
|
||||||
command = this.commands[this.index + 1]
|
|
||||||
} while (this.index < this.commands.length - 1 && currentGroupId && currentGroupId === command.groupId)
|
|
||||||
|
|
||||||
if (this.onStateDidChange) {
|
if (this.onStateDidChange) {
|
||||||
this.onStateDidChange()
|
this.onStateDidChange()
|
||||||
|
|
Loading…
Reference in a new issue