Hide composer and call buttons when the room is tombstoned (#7975)

This commit is contained in:
Michael Telatynski 2022-03-04 15:53:22 +00:00 committed by GitHub
parent 675b4271e9
commit 0e60ad98c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 196 additions and 93 deletions

View file

@ -40,6 +40,7 @@ import { contextMenuBelow } from './RoomTile';
import { RoomNotificationStateStore } from '../../../stores/notifications/RoomNotificationStateStore';
import { RightPanelPhases } from '../../../stores/right-panel/RightPanelStorePhases';
import { NotificationStateEvents } from '../../../stores/notifications/NotificationState';
import RoomContext from "../../../contexts/RoomContext";
export interface ISearchInfo {
searchTerm: string;
@ -73,6 +74,9 @@ export default class RoomHeader extends React.Component<IProps, IState> {
excludedRightPanelPhaseButtons: [],
};
static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
constructor(props, context) {
super(props, context);
const notiStore = RoomNotificationStateStore.instance.getRoomState(props.room);
@ -200,7 +204,10 @@ export default class RoomHeader extends React.Component<IProps, IState> {
const buttons: JSX.Element[] = [];
if (this.props.inRoom && SettingsStore.getValue("showCallButtonsInComposer")) {
if (this.props.inRoom &&
!this.context.tombstone &&
SettingsStore.getValue("showCallButtonsInComposer")
) {
const voiceCallButton = <AccessibleTooltipButton
className="mx_RoomHeader_button mx_RoomHeader_voiceCallButton"
onClick={() => this.props.onCallPlaced(CallType.Voice)}