* Abort any in-flight generation request.
()
| 295 | * Abort any in-flight generation request. |
| 296 | */ |
| 297 | stop(): void { |
| 298 | const runId = this.devtoolsBridge.getActiveRunId() |
| 299 | if (this.abortController) { |
| 300 | this.abortController.abort() |
| 301 | this.abortController = null |
| 302 | } |
| 303 | this.setIsLoading(false) |
| 304 | if (this.status === 'generating') { |
| 305 | this.setStatus('idle') |
| 306 | if (runId) { |
| 307 | this.devtoolsBridge.finishRun(runId, 'run:cancelled', 'cancelled') |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | /** |
| 313 | * Clear the result, error, and return to idle state. |
no test coverage detected