Spaces:
Sleeping
Sleeping
Sasha commited on
Commit ·
426c35b
1
Parent(s): 0252fea
Fix: handle non-array response for streams in App.jsx (prevent crash on rate-limiting)
Browse files- client/src/App.jsx +1 -1
client/src/App.jsx
CHANGED
|
@@ -271,7 +271,7 @@ export default function App() {
|
|
| 271 |
try {
|
| 272 |
const res = await fetch(`${API_BASE}/api/streams`);
|
| 273 |
const data = await res.json();
|
| 274 |
-
setStreams(data);
|
| 275 |
} catch (e) {
|
| 276 |
console.error('Failed to fetch streams:', e);
|
| 277 |
}
|
|
|
|
| 271 |
try {
|
| 272 |
const res = await fetch(`${API_BASE}/api/streams`);
|
| 273 |
const data = await res.json();
|
| 274 |
+
setStreams(Array.isArray(data) ? data : []);
|
| 275 |
} catch (e) {
|
| 276 |
console.error('Failed to fetch streams:', e);
|
| 277 |
}
|