Skip to content

Commit

Permalink
🐛 fix: 修复特殊情况下 avatar 配置不生效的问题 (#44)
Browse files Browse the repository at this point in the history
* 🐛 fix: slove avatar meta was not work
  • Loading branch information
ONLY-yours committed Jan 17, 2024
1 parent d1cf66d commit 4444f40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ChatItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const ChatItem = memo<ChatItemProps>((props) => {
if (chatItemRenderConfig?.titleRender === false) return null;
const dom = <Title avatar={avatar} placement={placement} showTitle={showTitle} time={time} />;
return chatItemRenderConfig?.titleRender?.(props, dom) || dom;
}, [time]);
}, [time, avatar]);

if (chatItemRenderConfig?.render === false) return null;

Expand Down
2 changes: 1 addition & 1 deletion src/ChatList/ChatListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ const Item = (props: ChatListItemProps) => {
/>
);
return dom;
}, [props.content, props.loading, props.id, item.updateAt || item.createAt]);
}, [props.content, props.loading, props.id, (item as any).meta, item.updateAt || item.createAt]);

if (RenderItem) return <RenderItem key={item.id} {...props} />;

Expand Down

0 comments on commit 4444f40

Please sign in to comment.