mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Rerender MessagePanel
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
97c5058f00
commit
c7e61ac71d
2 changed files with 15 additions and 0 deletions
|
@ -32,6 +32,7 @@ import {textForEvent} from "../../TextForEvent";
|
||||||
import IRCTimelineProfileResizer from "../views/elements/IRCTimelineProfileResizer";
|
import IRCTimelineProfileResizer from "../views/elements/IRCTimelineProfileResizer";
|
||||||
import DMRoomMap from "../../utils/DMRoomMap";
|
import DMRoomMap from "../../utils/DMRoomMap";
|
||||||
import NewRoomIntro from "../views/rooms/NewRoomIntro";
|
import NewRoomIntro from "../views/rooms/NewRoomIntro";
|
||||||
|
import dis from "../../dispatcher/dispatcher";
|
||||||
|
|
||||||
const CONTINUATION_MAX_INTERVAL = 5 * 60 * 1000; // 5 minutes
|
const CONTINUATION_MAX_INTERVAL = 5 * 60 * 1000; // 5 minutes
|
||||||
const continuedTypes = ['m.sticker', 'm.room.message'];
|
const continuedTypes = ['m.sticker', 'm.room.message'];
|
||||||
|
@ -203,6 +204,16 @@ export default class MessagePanel extends React.Component {
|
||||||
|
|
||||||
this._showTypingNotificationsWatcherRef =
|
this._showTypingNotificationsWatcherRef =
|
||||||
SettingsStore.watchSetting("showTypingNotifications", null, this.onShowTypingNotificationsChange);
|
SettingsStore.watchSetting("showTypingNotifications", null, this.onShowTypingNotificationsChange);
|
||||||
|
|
||||||
|
dis.register(this.onAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
onAction = payload => {
|
||||||
|
switch (payload.action) {
|
||||||
|
case "rerender_MessagePanel":
|
||||||
|
this.forceUpdate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
|
@ -147,6 +147,10 @@ export default class TextualBody extends React.Component {
|
||||||
pre.className = "mx_EventTile_collapsedCodeBlock";
|
pre.className = "mx_EventTile_collapsedCodeBlock";
|
||||||
button.className += "mx_EventTile_expandButton";
|
button.className += "mx_EventTile_expandButton";
|
||||||
}
|
}
|
||||||
|
/* Now we need to rerender the MessagePanel because the
|
||||||
|
* content's size has changed. Otherwise scrolling could
|
||||||
|
* get broken */
|
||||||
|
dis.dispatch({action: "rerender_MessagePanel"});
|
||||||
};
|
};
|
||||||
|
|
||||||
div.appendChild(button);
|
div.appendChild(button);
|
||||||
|
|
Loading…
Reference in a new issue