(data: ActionCallbackData)
| 73 | } |
| 74 | |
| 75 | async runAction(data: ActionCallbackData) { |
| 76 | const { actionId } = data; |
| 77 | const action = this.actions.get()[actionId]; |
| 78 | |
| 79 | if (!action) { |
| 80 | unreachable(`Action ${actionId} not found`); |
| 81 | } |
| 82 | |
| 83 | if (action.executed) { |
| 84 | return; |
| 85 | } |
| 86 | |
| 87 | this.#updateAction(actionId, { ...action, ...data.action, executed: true }); |
| 88 | |
| 89 | this.#currentExecutionPromise = this.#currentExecutionPromise |
| 90 | .then(() => { |
| 91 | return this.#executeAction(actionId); |
| 92 | }) |
| 93 | .catch((error) => { |
| 94 | console.error('Action failed:', error); |
| 95 | }); |
| 96 | } |
| 97 | |
| 98 | async #executeAction(actionId: string) { |
| 99 | const action = this.actions.get()[actionId]; |
nothing calls this directly
no test coverage detected