remove action queue optimization

This commit is contained in:
MapleLeaf
2021-12-23 09:39:34 -06:00
parent 11f56d35f1
commit e11f8a4e0f

View File

@@ -9,15 +9,8 @@ export class ActionQueue {
private runningPromise?: Promise<void> private runningPromise?: Promise<void>
add(action: Action) { add(action: Action) {
const lastAction = this.actions[this.actions.length - 1]
if (lastAction?.id === action.id) {
this.actions[this.actions.length - 1] = action
} else {
this.actions.push(action) this.actions.push(action)
}
this.actions.sort((a, b) => a.priority - b.priority) this.actions.sort((a, b) => a.priority - b.priority)
this.runActions() this.runActions()
} }