[PlayerPanel] addPanelInfoToPlayList() spread error
This commit is contained in:
@@ -566,11 +566,11 @@ const PlayerPanel = ({
|
||||
(featuredShowsInfos) => {
|
||||
const updatedPlayListInfo = [
|
||||
{ ...showDetailInfo[0] },
|
||||
...featuredShowsInfos,
|
||||
...(Array.isArray(featuredShowsInfos) ? featuredShowsInfos : []),
|
||||
];
|
||||
setPlayListInfo(updatedPlayListInfo);
|
||||
},
|
||||
[showDetailInfo]
|
||||
[showDetailInfo, setPlayListInfo]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -1031,6 +1031,8 @@ const PlayerPanel = ({
|
||||
}, [playListInfo, selectedIndex]);
|
||||
|
||||
const handleIndicatorDownClick = useCallback(() => {
|
||||
if (!playListInfo[selectedIndex + 1].showId) return;
|
||||
|
||||
if (playListInfo.length - 1 === selectedIndex) {
|
||||
return setSelectedIndex(0);
|
||||
}
|
||||
@@ -1050,6 +1052,7 @@ const PlayerPanel = ({
|
||||
}, [dispatch, playListInfo, selectedIndex]);
|
||||
|
||||
const handleIndicatorUpClick = useCallback(() => {
|
||||
if (!playListInfo[selectedIndex - 1].showId) return;
|
||||
if (selectedIndex === 0) {
|
||||
setSelectedIndex(playListInfo.length - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user