File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 if ( data && data . tracks ) WidgetHome . playList = data . tracks ;
1919 audioPlayer . getCurrentTrack ( function ( track , err ) {
2020 if ( track ) {
21- if ( WidgetHome . playList . findIndex ( i => i . url === track ) >= 0 ) {
22- WidgetHome . currentTrack = track ;
21+ let trackFromPlaylist = WidgetHome . playList . find ( i => i . url === track ) ;
22+ if ( trackFromPlaylist ) {
23+ WidgetHome . currentTrack = trackFromPlaylist ;
2324 WidgetHome . isRangeDisabled = false ;
2425 console . log ( "Current track set" ) ;
2526 $scope . $digest ( ) ;
26- }
27- else {
28- console . log ( "current track null" ) ;
29- WidgetHome . currentTrack = null ;
27+ } else {
28+ WidgetHome . currentTrack = track ;
3029 $scope . $digest ( ) ;
31- }
30+ }
3231 }
33- else WidgetHome . currentTrack = null ;
3432 console . log ( 'audioPlayer.getCurrentTrack method called--------------------------------' , track , err ) ;
3533 } ) ;
34+
3635 } )
3736
3837 /**
You can’t perform that action at this time.
0 commit comments