Threads notifications after app startup (#7253)

This commit is contained in:
Germain 2021-12-07 12:51:34 +00:00 committed by GitHub
parent b4b81a455e
commit 38e5e94ee4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 194 additions and 28 deletions

View file

@ -72,6 +72,7 @@ export default class ThreadView extends React.Component<IProps, IState> {
super(props);
this.state = {};
}
public componentDidMount(): void {
this.setupThread(this.props.mxEvent);
this.dispatcherRef = dis.register(this.onAction);
@ -166,10 +167,11 @@ export default class ThreadView extends React.Component<IProps, IState> {
};
private updateThread = (thread?: Thread) => {
if (thread) {
if (thread && this.state.thread !== thread) {
this.setState({
thread,
});
thread.emit(ThreadEvent.ViewThread);
}
this.timelinePanelRef.current?.refreshTimeline();