FIX: Live Broadcast Not Appearing

Style: Added some Styling
This commit is contained in:
EvanLin3141
2025-03-04 18:30:08 +00:00
parent 116ac451fa
commit 69a2405c90
3 changed files with 10 additions and 6 deletions

View File

@@ -105,6 +105,7 @@ export function useStreams(customUrl?: string): {
const [streams, setStreams] = useState<StreamType[]>([]); const [streams, setStreams] = useState<StreamType[]>([]);
const [isLoading, setIsLoading] = useState(true); const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState<string | null>(null); const [error, setError] = useState<string | null>(null);
console.log(streams)
useEffect(() => { useEffect(() => {
const fetchStreams = async () => { const fetchStreams = async () => {
@@ -158,7 +159,11 @@ export function useStreams(customUrl?: string): {
} }
const data = await response.json(); 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); setError(null);
@@ -184,7 +189,6 @@ export function useStreams(customUrl?: string): {
fetchStreams(); fetchStreams();
}, [isLoggedIn, customUrl]); }, [isLoggedIn, customUrl]);
return { streams, isLoading, error }; return { streams, isLoading, error };
} }

View File

@@ -217,12 +217,12 @@ const UserPage: React.FC = () => {
{/* Content Section */} {/* Content Section */}
<div <div
id="content" id="content"
className="col-span-2 bg-[var(--user-contentBox)] rounded-lg p-6 grid grid-rows-[auto_1fr] text-center items-center justify-center" className="col-span-2 bg-[var(--user-contentBox)] rounded-lg p-6 flex flex-col items-center w-full"
> >
{/* Stream */} {/* Stream */}
{currentStream && ( {currentStream && (
<div className="mb-8"> <div className="mb-8">
<h2 className="text-2xl bg-[#ff0000] border py-4 px-12 font-black mb-4 rounded-[4rem]">Currently Live!</h2> <h2 className="text-2xl bg-[#ff0000] border py-4 px-[9rem] font-black mb-4 rounded-[4rem]">Currently Live!</h2>
<StreamListItem <StreamListItem
id={profileData.id} id={profileData.id}
title={currentStream.title || ""} title={currentStream.title || ""}

View File

@@ -87,7 +87,7 @@ def stream_data(username=None, streamer_id=None) -> dict:
else: else:
data = {"stream_key": stream_key["stream_key"]} data = {"stream_key": stream_key["stream_key"]}
return jsonify(data) return jsonify([data])
# Category Routes # Category Routes