[PlayerPanel] showNm null error

This commit is contained in:
고동영
2024-06-25 13:35:39 +09:00
parent 3860ba7d17
commit 74695b64e1

View File

@@ -56,15 +56,19 @@ export default function PlayerOverlayContents({
setIsSubtitleActive((prev) => !prev);
};
const getPartnerInfo = (key) => {
if (playListInfo) {
if (key !== "patncLogoPath" && type === "MEDIA") {
return;
const getPartnerInfo = useCallback(
(key) => {
if (playListInfo) {
if (key !== "patncLogoPath" && type === "MEDIA") {
return;
}
return playListInfo[selectedIndex]?.[key];
}
return playListInfo[selectedIndex]?.[key];
}
return panelInfo?.[key];
};
return panelInfo?.[key];
},
[playListInfo, type]
);
const patncLogoPath = useMemo(
() => getPartnerInfo("patncLogoPath"),
[playListInfo, selectedIndex, panelInfo]
@@ -77,7 +81,7 @@ export default function PlayerOverlayContents({
const showName = useMemo(() => {
const name = getPartnerInfo("showNm");
return name.replace(/<br\s*\/?>/gi, " ");
return name ? name.replace(/<br\s*\/?>/gi, " ") : "";
}, [playListInfo, selectedIndex, panelInfo]);
const onSpotlightMoveTabButton = (e) => {