()
| 1194 | let lastDispatched = ''; |
| 1195 | let flushTimer: ReturnType<typeof setTimeout> | null = null; |
| 1196 | const flushNow = () => { |
| 1197 | if (flushTimer) { |
| 1198 | clearTimeout(flushTimer); |
| 1199 | flushTimer = null; |
| 1200 | } |
| 1201 | if (accumulatedMarkdown === lastDispatched) return; |
| 1202 | lastDispatched = accumulatedMarkdown; |
| 1203 | const titleMatch = accumulatedMarkdown.match(/^#\s+(.+)$/m); |
| 1204 | dispatch(dfActions.updateGeneratedReportContent({ |
| 1205 | id: reportId, |
| 1206 | content: accumulatedMarkdown, |
| 1207 | title: titleMatch ? titleMatch[1].trim() : undefined, |
| 1208 | })); |
| 1209 | }; |
| 1210 | const scheduleFlush = () => { |
| 1211 | if (flushTimer) return; |
| 1212 | flushTimer = setTimeout(() => { |
no outgoing calls
no test coverage detected