refactor(ChatWindow): 移除调试日志并优化头像显示逻辑

删除无用的console.log调试信息,避免生产环境输出敏感数据
头像显示逻辑改为优先使用contract.avatar,不存在时使用contract.chatroomAvatar作为备选
This commit is contained in:
超级老白兔
2025-09-04 11:25:23 +08:00
parent 37da3e8350
commit 2d78c2a37a

View File

@@ -43,9 +43,6 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
useEffect(() => {
const prevMessages = prevMessagesRef.current;
// 检查是否有视频状态变化(从加载中变为已完成或开始加载)
console.log("currentMessages", currentMessages);
const hasVideoStateChange = currentMessages.some((msg, index) => {
const prevMsg = prevMessages[index];
if (!prevMsg || prevMsg.id !== msg.id) return false;
@@ -591,7 +588,7 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
<div className={styles.chatHeaderInfo}>
<Avatar
size={40}
src={contract.avatar}
src={contract.avatar || contract.chatroomAvatar}
icon={
contract.type === "group" ? <TeamOutlined /> : <UserOutlined />
}