Fix HeaderButtons handler bindings

This commit is contained in:
Michael Telatynski 2020-09-04 12:14:43 +01:00
parent bdfb77077a
commit f28c396b1e
2 changed files with 10 additions and 12 deletions
src/components/views/right_panel

View file

@ -41,8 +41,6 @@ interface IProps {}
export default class GroupHeaderButtons extends HeaderButtons {
constructor(props: IProps) {
super(props, HeaderKind.Group);
this.onMembersClicked = this.onMembersClicked.bind(this);
this.onRoomsClicked = this.onRoomsClicked.bind(this);
}
protected onAction(payload: ActionPayload) {
@ -68,7 +66,7 @@ export default class GroupHeaderButtons extends HeaderButtons {
}
}
private onMembersClicked() {
private onMembersClicked = () => {
if (this.state.phase === RightPanelPhases.GroupMemberInfo) {
// send the active phase to trigger a toggle
this.setPhase(RightPanelPhases.GroupMemberInfo);
@ -76,12 +74,12 @@ export default class GroupHeaderButtons extends HeaderButtons {
// This toggles for us, if needed
this.setPhase(RightPanelPhases.GroupMemberList);
}
}
};
private onRoomsClicked() {
private onRoomsClicked = () => {
// This toggles for us, if needed
this.setPhase(RightPanelPhases.GroupRoomList);
}
};
renderButtons() {
return [

View file

@ -54,7 +54,7 @@ export default class RoomHeaderButtons extends HeaderButtons {
}
}
private onMembersClicked() {
private onMembersClicked = () => {
if (this.state.phase === RightPanelPhases.RoomMemberInfo) {
// send the active phase to trigger a toggle
// XXX: we should pass refireParams here but then it won't collapse as we desire it to
@ -63,17 +63,17 @@ export default class RoomHeaderButtons extends HeaderButtons {
// This toggles for us, if needed
this.setPhase(RightPanelPhases.RoomMemberList);
}
}
};
private onFilesClicked() {
private onFilesClicked = () => {
// This toggles for us, if needed
this.setPhase(RightPanelPhases.FilePanel);
}
};
private onNotificationsClicked() {
private onNotificationsClicked = () => {
// This toggles for us, if needed
this.setPhase(RightPanelPhases.NotificationPanel);
}
};
public renderButtons() {
return [