diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx index 7c5c5b469b..09f201e3ef 100644 --- a/src/components/views/rooms/RoomTile.tsx +++ b/src/components/views/rooms/RoomTile.tsx @@ -120,6 +120,12 @@ export default class RoomTile extends React.PureComponent { return !this.props.isMinimized && this.props.showMessagePreview; } + public componentDidUpdate(prevProps: Readonly, prevState: Readonly) { + if (prevProps.showMessagePreview !== this.props.showMessagePreview && this.showMessagePreview) { + this.setState({messagePreview: this.generatePreview()}); + } + } + public componentDidMount() { // when we're first rendered (or our sublist is expanded) make sure we are visible if we're active if (this.state.selected) {