Spaces:
Sleeping
Sleeping
fix spinner
Browse files- web/src/App.tsx +3 -14
web/src/App.tsx
CHANGED
|
@@ -368,20 +368,9 @@ function App() {
|
|
| 368 |
const { done, value } = await reader.read();
|
| 369 |
|
| 370 |
if (done) {
|
| 371 |
-
//
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
for (const line of remainingLines) {
|
| 375 |
-
if (!line.trim()) continue;
|
| 376 |
-
const eventMatch = line.match(/^event: (.+)$/m);
|
| 377 |
-
const dataMatch = line.match(/^data: (.+)$/m);
|
| 378 |
-
if (eventMatch && dataMatch && eventMatch[1] === 'done') {
|
| 379 |
-
// Clear loading state when done event is found
|
| 380 |
-
setIsLoading(false);
|
| 381 |
-
setStatusMessage('');
|
| 382 |
-
}
|
| 383 |
-
}
|
| 384 |
-
}
|
| 385 |
break;
|
| 386 |
}
|
| 387 |
|
|
|
|
| 368 |
const { done, value } = await reader.read();
|
| 369 |
|
| 370 |
if (done) {
|
| 371 |
+
// Stream ended - immediately clear loading state
|
| 372 |
+
setIsLoading(false);
|
| 373 |
+
setStatusMessage('');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 374 |
break;
|
| 375 |
}
|
| 376 |
|