1.1
This commit is contained in:
parent
3ea6b2dc42
commit
0dfcc2039f
@ -55,20 +55,25 @@ const portalHighlights = [
|
||||
];
|
||||
|
||||
const fallbackTickerItems = [
|
||||
{ id: 'fallback-1', title: 'Prime Time Studio', stream_type: 'video', status: 'live', starts_at: new Date().toISOString() },
|
||||
{ id: 'fallback-2', title: 'Evening Bulletin', stream_type: 'audio', status: 'scheduled', starts_at: new Date(Date.now() + 45 * 60 * 1000).toISOString() },
|
||||
{ id: 'fallback-3', title: 'Culture Call-In', stream_type: 'audio', status: 'live', starts_at: new Date().toISOString() },
|
||||
{ id: 'fallback-4', title: 'Weekend Music Hour', stream_type: 'video', status: 'scheduled', starts_at: new Date(Date.now() + 2 * 60 * 60 * 1000).toISOString() },
|
||||
{ id: 'fallback-1', title: 'Prime Time Studio', stream_type: 'video', status: 'live', starts_at: '2026-04-05T18:00:00.000Z' },
|
||||
{ id: 'fallback-2', title: 'Evening Bulletin', stream_type: 'audio', status: 'scheduled', starts_at: '2026-04-05T18:45:00.000Z' },
|
||||
{ id: 'fallback-3', title: 'Culture Call-In', stream_type: 'audio', status: 'live', starts_at: '2026-04-05T19:30:00.000Z' },
|
||||
{ id: 'fallback-4', title: 'Weekend Music Hour', stream_type: 'video', status: 'scheduled', starts_at: '2026-04-05T20:00:00.000Z' },
|
||||
];
|
||||
|
||||
export default function HomePage() {
|
||||
const router = useRouter();
|
||||
const [tickerStreams, setTickerStreams] = useState<any[]>([]);
|
||||
const [selectedTickerStreamId, setSelectedTickerStreamId] = useState('');
|
||||
const [hasHydrated, setHasHydrated] = useState(false);
|
||||
const [isNowPlayingVisible, setIsNowPlayingVisible] = useState(false);
|
||||
const [isNowPlayingMinimized, setIsNowPlayingMinimized] = useState(false);
|
||||
const [hasDismissedNowPlaying, setHasDismissedNowPlaying] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setHasHydrated(true);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
let isMounted = true;
|
||||
|
||||
@ -96,7 +101,13 @@ export default function HomePage() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const tickerItems = useMemo(() => (tickerStreams.length ? tickerStreams : fallbackTickerItems), [tickerStreams]);
|
||||
const tickerItems = useMemo(() => {
|
||||
if (!hasHydrated) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return tickerStreams.length ? tickerStreams : fallbackTickerItems;
|
||||
}, [hasHydrated, tickerStreams]);
|
||||
const queryStreamId = useMemo(() => getPublicStreamQueryId(router.query.stream), [router.query.stream]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user