refactor: more TS code

This commit is contained in:
Tristan Yang
2022-07-11 16:28:02 +08:00
parent c7eae47fb2
commit 45a147ae67
18 changed files with 132 additions and 113 deletions
@@ -15,7 +15,7 @@ const PreviewMessage: FC<Props> = ({ mid = 0 }) => {
});
if (!msg) return null;
const { from_uid, created_at, content_type, content, thumbnail, properties } = msg;
const { name, avatar } = usersData[from_uid];
const { name, avatar } = usersData[from_uid] || {};
return (
<StyledWrapper className={`preview`}>
<div className="avatar">