Footer enhancements and performance optimizations #9
1 changed files with 6 additions and 2 deletions
|
@ -80,8 +80,12 @@ export default function Home() {
|
||||||
activeRes.json()
|
activeRes.json()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
setStreams(streamsData);
|
// Handle both old and new API response formats
|
||||||
setActiveSources(activeData);
|
const streams = streamsData.success ? streamsData.data : streamsData;
|
||||||
|
const activeSources = activeData.success ? activeData.data : activeData;
|
||||||
|
|
||||||
|
setStreams(streams);
|
||||||
|
setActiveSources(activeSources);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching data:', error);
|
console.error('Error fetching data:', error);
|
||||||
showError('Failed to Load Data', 'Could not fetch streams. Please refresh the page.');
|
showError('Failed to Load Data', 'Could not fetch streams. Please refresh the page.');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue