[PlayerPanel] chatData clear
This commit is contained in:
@@ -40,7 +40,7 @@ export const playReducer = (state = initialState, action) => {
|
||||
case types.CLEAR_PLAYER_INFO: {
|
||||
return {
|
||||
...state,
|
||||
chatData: null,
|
||||
chatData: {},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -50,54 +50,55 @@ export default function PlayerOverlayChat({
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={classNames(
|
||||
css.chatContainer,
|
||||
videoVerticalVisible && css.verticalChat
|
||||
)}
|
||||
>
|
||||
<div className={css.chatHeader} aria-label="LIVE CHAT">
|
||||
{$L("LIVE CHAT")}
|
||||
</div>
|
||||
{chatData && Object.keys(chatData).length > 0 && (
|
||||
<div
|
||||
className={classNames(
|
||||
css.contents,
|
||||
videoVerticalVisible && css.verticalContent
|
||||
css.chatContainer,
|
||||
videoVerticalVisible && css.verticalChat
|
||||
)}
|
||||
>
|
||||
{recentChats &&
|
||||
recentChats.length > 0 &&
|
||||
recentChats.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={css.chatItem}
|
||||
style={{ order: -index }}
|
||||
>
|
||||
<div className={css.username} aria-label={item?.username}>
|
||||
{item?.username}
|
||||
</div>
|
||||
<div className={css.content} aria-label={item?.content}>
|
||||
{item?.content}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
{!videoVerticalVisible && imageQRCodeUrl && (
|
||||
<TButton
|
||||
className={css.messageBtn}
|
||||
onClick={handleQRCodeClick}
|
||||
ariaLabel="TYPE A MESSAGE"
|
||||
<div className={css.chatHeader} aria-label="LIVE CHAT">
|
||||
{$L("LIVE CHAT")}
|
||||
</div>
|
||||
<div
|
||||
className={classNames(
|
||||
css.contents,
|
||||
videoVerticalVisible && css.verticalContent
|
||||
)}
|
||||
>
|
||||
{"TYPE A MESSAGE"}
|
||||
</TButton>
|
||||
)}
|
||||
{!videoVerticalVisible && (
|
||||
<p className={css.chatclose} aria-label="chat close, button">
|
||||
X
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{recentChats &&
|
||||
recentChats.length > 0 &&
|
||||
recentChats.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={css.chatItem}
|
||||
style={{ order: -index }}
|
||||
>
|
||||
<div className={css.username} aria-label={item?.username}>
|
||||
{item?.username}
|
||||
</div>
|
||||
<div className={css.content} aria-label={item?.content}>
|
||||
{item?.content}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
{!videoVerticalVisible && imageQRCodeUrl && (
|
||||
<TButton
|
||||
className={css.messageBtn}
|
||||
onClick={handleQRCodeClick}
|
||||
ariaLabel="TYPE A MESSAGE"
|
||||
>
|
||||
{"TYPE A MESSAGE"}
|
||||
</TButton>
|
||||
)}
|
||||
{!videoVerticalVisible && (
|
||||
<p className={css.chatclose} aria-label="chat close, button">
|
||||
X
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{activePopup === ACTIVE_POPUP.qrPopup && (
|
||||
<TPopUp kind="qrPopup" open={popupVisible} onClose={onClose}>
|
||||
<div className={css.popupContainer}>
|
||||
|
||||
@@ -953,6 +953,7 @@ const PlayerPanel = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (showDetailInfo && showDetailInfo.length > 0) {
|
||||
dispatch(CLEAR_PLAYER_INFO());
|
||||
if (
|
||||
showDetailInfo[0]?.chatFlag === "Y" &&
|
||||
panelInfo.shptmBanrTpNm === "VOD"
|
||||
|
||||
Reference in New Issue
Block a user