Fix CallEventGrouper map building to not occur during a Render phase (#7638)

This commit is contained in:
Michael Telatynski 2022-01-27 11:08:28 +00:00 committed by GitHub
parent ae490841c6
commit f2249b3e37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 23 deletions

View file

@ -41,9 +41,8 @@ const room = new Matrix.Room("!roomId:server_name");
// wrap MessagePanel with a component which provides the MatrixClient in the context.
class WrappedMessagePanel extends React.Component {
state = {
resizeNotifier: new EventEmitter(),
};
resizeNotifier = new EventEmitter();
callEventGroupers = new Map();
render() {
const roomContext = {
@ -60,7 +59,12 @@ class WrappedMessagePanel extends React.Component {
return <MatrixClientContext.Provider value={client}>
<RoomContext.Provider value={roomContext}>
<MessagePanel room={room} {...this.props} resizeNotifier={this.state.resizeNotifier} />
<MessagePanel
room={room}
{...this.props}
resizeNotifier={this.resizeNotifier}
callEventGroupers={this.callEventGroupers}
/>
</RoomContext.Provider>
</MatrixClientContext.Provider>;
}