remove action queue optimization
This commit is contained in:
@@ -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]
|
this.actions.push(action)
|
||||||
if (lastAction?.id === action.id) {
|
|
||||||
this.actions[this.actions.length - 1] = action
|
|
||||||
} else {
|
|
||||||
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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user