Pass room to getRoomTombstone to avoid racing with setState (#7986)
This commit is contained in:
parent
6174b13142
commit
aa48cfd0a0
1 changed files with 3 additions and 3 deletions
|
@ -1028,13 +1028,13 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||||
this.checkWidgets(room);
|
this.checkWidgets(room);
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
tombstone: this.getRoomTombstone(),
|
tombstone: this.getRoomTombstone(room),
|
||||||
liveTimeline: room.getLiveTimeline(),
|
liveTimeline: room.getLiveTimeline(),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
private getRoomTombstone() {
|
private getRoomTombstone(room = this.state.room) {
|
||||||
return this.state.room?.currentState.getStateEvents(EventType.RoomTombstone, "");
|
return room?.currentState.getStateEvents(EventType.RoomTombstone, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async calculateRecommendedVersion(room: Room) {
|
private async calculateRecommendedVersion(room: Room) {
|
||||||
|
|
Loading…
Reference in a new issue