From 69a2405c9059f5cbf8981588ef079173a1125911 Mon Sep 17 00:00:00 2001 From: EvanLin3141 Date: Tue, 4 Mar 2025 18:30:08 +0000 Subject: [PATCH] FIX: Live Broadcast Not Appearing Style: Added some Styling --- frontend/src/hooks/useContent.ts | 8 ++++++-- frontend/src/pages/UserPage.tsx | 6 +++--- web_server/blueprints/streams.py | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/hooks/useContent.ts b/frontend/src/hooks/useContent.ts index 58ae5a7..16ddb65 100644 --- a/frontend/src/hooks/useContent.ts +++ b/frontend/src/hooks/useContent.ts @@ -105,6 +105,7 @@ export function useStreams(customUrl?: string): { const [streams, setStreams] = useState([]); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); + console.log(streams) useEffect(() => { const fetchStreams = async () => { @@ -158,7 +159,11 @@ export function useStreams(customUrl?: string): { } const data = await response.json(); - setStreams(processStreamData(data)); + console.log("Data: ", data) + + // Make sure it is 100% ARRAY NOT OBJECT + const formattedData = Array.isArray(data) ? data : [data]; + setStreams(processStreamData(formattedData)); } setError(null); @@ -184,7 +189,6 @@ export function useStreams(customUrl?: string): { fetchStreams(); }, [isLoggedIn, customUrl]); - return { streams, isLoading, error }; } diff --git a/frontend/src/pages/UserPage.tsx b/frontend/src/pages/UserPage.tsx index f4d12ce..45fa132 100644 --- a/frontend/src/pages/UserPage.tsx +++ b/frontend/src/pages/UserPage.tsx @@ -217,12 +217,12 @@ const UserPage: React.FC = () => { {/* Content Section */}
+ className="col-span-2 bg-[var(--user-contentBox)] rounded-lg p-6 flex flex-col items-center w-full" + > {/* Stream */} {currentStream && (
-

Currently Live!

+

Currently Live!

dict: else: data = {"stream_key": stream_key["stream_key"]} - return jsonify(data) + return jsonify([data]) # Category Routes