Footer enhancements and performance optimizations #9

Merged
deco merged 10 commits from footer-enhancements into main 2025-07-22 23:01:23 +03:00
5 changed files with 7 additions and 17 deletions
Showing only changes of commit 8c2de2c66b - Show all commits

View file

@ -65,8 +65,7 @@ export default function EditStream() {
team_id: streamData.team_id,
});
// Handle both old and new API response formats
const teams = teamsData.success ? teamsData.data : teamsData;
const teams = teamsData.data;
// Map teams for dropdown
setTeams(

View file

@ -80,12 +80,8 @@ export default function Home() {
activeRes.json()
]);
// Handle both old and new API response formats
const streams = streamsData.success ? streamsData.data : streamsData;
const activeSources = activeData.success ? activeData.data : activeData;
setStreams(streams);
setActiveSources(activeSources);
setStreams(streamsData.data);
setActiveSources(activeData);
} catch (error) {
console.error('Error fetching data:', error);
showError('Failed to Load Data', 'Could not fetch streams. Please refresh the page.');

View file

@ -40,9 +40,8 @@ export default function AddStream() {
const teamsData = await teamsResponse.json();
const streamsData = await streamsResponse.json();
// Handle both old and new API response formats
const teams = teamsData.success ? teamsData.data : teamsData;
const streams = streamsData.success ? streamsData.data : streamsData;
const teams = teamsData.data;
const streams = streamsData.data;
// Map the API data to the format required by the Dropdown
setTeams(

View file

@ -41,9 +41,7 @@ export default function Teams() {
try {
const res = await fetch('/api/teams');
const data = await res.json();
// Handle both old and new API response formats
const teams = data.success ? data.data : data;
setTeams(teams);
setTeams(data.data);
} catch (error) {
console.error('Error fetching teams:', error);
} finally {

View file

@ -50,9 +50,7 @@ export default function Footer() {
try {
const response = await fetch('/api/counts');
const data = await response.json();
// Handle both old and new API response formats
const countsData = data.success ? data.data : data;
setCounts(countsData);
setCounts(data.data);
} catch (error) {
console.error('Failed to fetch counts:', error);
}