()
| 67 | } |
| 68 | |
| 69 | async function generate(): Promise<void> { |
| 70 | pendingRef.current = false |
| 71 | if (hasSummarySinceLastUserTurn(messagesRef.current)) return |
| 72 | abortInFlight() |
| 73 | const controller = new AbortController() |
| 74 | abortRef.current = controller |
| 75 | const text = await generateAwaySummary( |
| 76 | messagesRef.current, |
| 77 | controller.signal, |
| 78 | ) |
| 79 | if (controller.signal.aborted || text === null) return |
| 80 | setMessages(prev => [...prev, createAwaySummaryMessage(text)]) |
| 81 | } |
| 82 | |
| 83 | function onBlurTimerFire(): void { |
| 84 | timerRef.current = null |
no test coverage detected