From 240cb10415bc161b81dad87028328fd803aa8253 Mon Sep 17 00:00:00 2001 From: Germain Date: Fri, 14 Jan 2022 12:49:25 +0000 Subject: [PATCH] Refresh ThreadView after React state has been updated (#7539) --- src/components/structures/ThreadView.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index 4f992c4f43..71efae0c6a 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -165,11 +165,11 @@ export default class ThreadView extends React.Component { if (thread && this.state.thread !== thread) { this.setState({ thread, + }, () => { + thread.emit(ThreadEvent.ViewThread); + this.timelinePanelRef.current?.refreshTimeline(); }); - thread.emit(ThreadEvent.ViewThread); } - - this.timelinePanelRef.current?.refreshTimeline(); }; private onScroll = (): void => {