11import React , { useEffect , useState , useMemo , useCallback } from 'react' ;
2+ import he from 'he' ;
23import { debugError } from '@utils/Debug' ;
34import {
45 View ,
@@ -35,6 +36,7 @@ import { COLORS, CORE_COLORS } from '@utils/Colors';
3536import { formatArchiveDate } from '@utils/DateTime' ;
3637
3738import HomeNowPlaying from './HomeNowPlaying' ;
39+ import { ScheduleService } from '@services/ScheduleService' ;
3840
3941const streamUrl = 'https://wmbr.org:8002/hi' ;
4042
@@ -56,6 +58,8 @@ export default function HomeScreen() {
5658 liveStreamUrl : streamUrl ,
5759 } ) ;
5860
61+ const scheduleService = ScheduleService . getInstance ( ) ;
62+
5963 const isPlaying = playbackState ?. state === State . Playing ;
6064
6165 const navigation =
@@ -99,7 +103,7 @@ export default function HomeScreen() {
99103 const unsubscribeMetadata = metadataService . subscribe ( ( data : ShowInfo ) => {
100104 setShowInfo ( data ) ;
101105 setCurrentShow ( data . showTitle ) ;
102- setHosts ( data . hosts ) ;
106+ setHosts ( he . decode ( data . hosts || '' ) ) ;
103107 setShowDescription ( data . description ) ;
104108
105109 try {
@@ -240,25 +244,32 @@ export default function HomeScreen() {
240244 await TrackPlayer . seekTo ( newPosition ) ;
241245 } , [ progress . position , progress . duration ] ) ;
242246
243- const handleOpenShowDetails = useCallback ( ( ) => {
247+ const handleOpenShowDetails = useCallback ( async ( ) => {
244248 const show = archiveState . currentShow ;
245249 if ( ! show ) return ;
246250
251+ const scheduleShow = await scheduleService . getShowById ( show . id ) ;
252+
247253 // Navigate to Schedule tab with complete stack state
248254 navigation . navigate ( 'Schedule' as WmbrRouteName , {
249255 // Specify the complete stack path
250256 state : {
251257 routes : [
252258 { name : 'ScheduleMain' } ,
253- { name : 'ShowDetails' , params : { show } } ,
259+ { name : 'ShowDetails' , params : { show, scheduleShow } } ,
254260 {
255261 name : 'ArchivedShowView' ,
256262 params : { show, archive : archiveState . currentArchive } ,
257263 } ,
258264 ] ,
259265 } ,
260266 } ) ;
261- } , [ archiveState . currentShow , archiveState . currentArchive , navigation ] ) ;
267+ } , [
268+ archiveState . currentShow ,
269+ archiveState . currentArchive ,
270+ scheduleService ,
271+ navigation ,
272+ ] ) ;
262273
263274 if ( showSplash ) return < SplashScreen onAnimationEnd = { handleSplashEnd } /> ;
264275
0 commit comments