Keep room name up-to-date in settings dialog
Signed-off-by: Paulo Pinto <paulo.pinto@automattic.com>
This commit is contained in:
parent
ea55b0d45f
commit
53f26d2744
1 changed files with 3 additions and 0 deletions
|
@ -59,6 +59,7 @@ export default class RoomSettingsDialog extends React.Component<IProps, IState>
|
||||||
|
|
||||||
public componentDidMount() {
|
public componentDidMount() {
|
||||||
this.dispatcherRef = dis.register(this.onAction);
|
this.dispatcherRef = dis.register(this.onAction);
|
||||||
|
MatrixClientPeg.get().on("Room.name", this.setRoomName);
|
||||||
this.setRoomName();
|
this.setRoomName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +67,8 @@ export default class RoomSettingsDialog extends React.Component<IProps, IState>
|
||||||
if (this.dispatcherRef) {
|
if (this.dispatcherRef) {
|
||||||
dis.unregister(this.dispatcherRef);
|
dis.unregister(this.dispatcherRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MatrixClientPeg.get().removeListener("Room.name", this.setRoomName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private onAction = (payload): void => {
|
private onAction = (payload): void => {
|
||||||
|
|
Loading…
Reference in a new issue