mirror of
https://github.com/element-hq/element-web
synced 2024-11-25 10:45:51 +03:00
Fix issues with ThreadSummary in msc-enabled mode (#8018)
This commit is contained in:
parent
225581de6a
commit
5902ddaf06
1 changed files with 8 additions and 8 deletions
|
@ -68,11 +68,13 @@ const ThreadSummary = ({ mxEvent, thread }: IProps) => {
|
|||
|
||||
export const ThreadMessagePreview = ({ thread }: Pick<IProps, "thread">) => {
|
||||
const cli = useContext(MatrixClientContext);
|
||||
const lastReply = useTypedEventEmitterState(thread, ThreadEvent.Update, () => thread.lastReply());
|
||||
const lastReply = useTypedEventEmitterState(thread, ThreadEvent.Update, () => thread.replyToEvent);
|
||||
const preview = useAsyncMemo(async () => {
|
||||
if (!lastReply) return;
|
||||
await cli.decryptEventIfNeeded(lastReply);
|
||||
return MessagePreviewStore.instance.generatePreviewForEvent(lastReply);
|
||||
}, [lastReply]);
|
||||
if (!preview) return null;
|
||||
|
||||
const sender = thread.roomState.getSentinelMember(lastReply.getSender());
|
||||
return <>
|
||||
|
@ -83,13 +85,11 @@ export const ThreadMessagePreview = ({ thread }: Pick<IProps, "thread">) => {
|
|||
height={24}
|
||||
className="mx_ThreadInfo_avatar"
|
||||
/>
|
||||
{ preview && (
|
||||
<div className="mx_ThreadInfo_content">
|
||||
<span className="mx_ThreadInfo_message-preview">
|
||||
{ preview }
|
||||
</span>
|
||||
</div>
|
||||
) }
|
||||
<div className="mx_ThreadInfo_content">
|
||||
<span className="mx_ThreadInfo_message-preview">
|
||||
{ preview }
|
||||
</span>
|
||||
</div>
|
||||
</>;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue