mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Merge pull request #4228 from matrix-org/jryans/hide-video-config-release
Add default on config setting to control call button in composer
This commit is contained in:
commit
6e90498739
2 changed files with 18 additions and 3 deletions
|
@ -178,6 +178,7 @@ export default class MessageComposer extends React.Component {
|
||||||
isQuoting: Boolean(RoomViewStore.getQuotingEvent()),
|
isQuoting: Boolean(RoomViewStore.getQuotingEvent()),
|
||||||
tombstone: this._getRoomTombstone(),
|
tombstone: this._getRoomTombstone(),
|
||||||
canSendMessages: this.props.room.maySendMessage(),
|
canSendMessages: this.props.room.maySendMessage(),
|
||||||
|
showCallButtons: SettingsStore.getValue("showCallButtonsInComposer"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,10 +326,20 @@ export default class MessageComposer extends React.Component {
|
||||||
permalinkCreator={this.props.permalinkCreator} />,
|
permalinkCreator={this.props.permalinkCreator} />,
|
||||||
<Stickerpicker key='stickerpicker_controls_button' room={this.props.room} />,
|
<Stickerpicker key='stickerpicker_controls_button' room={this.props.room} />,
|
||||||
<UploadButton key="controls_upload" roomId={this.props.room.roomId} />,
|
<UploadButton key="controls_upload" roomId={this.props.room.roomId} />,
|
||||||
callInProgress ? <HangupButton key="controls_hangup" roomId={this.props.room.roomId} /> : null,
|
|
||||||
callInProgress ? null : <CallButton key="controls_call" roomId={this.props.room.roomId} />,
|
|
||||||
callInProgress ? null : <VideoCallButton key="controls_videocall" roomId={this.props.room.roomId} />,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (this.state.showCallButtons) {
|
||||||
|
if (callInProgress) {
|
||||||
|
controls.push(
|
||||||
|
<HangupButton key="controls_hangup" roomId={this.props.room.roomId} />,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
controls.push(
|
||||||
|
<CallButton key="controls_call" roomId={this.props.room.roomId} />,
|
||||||
|
<VideoCallButton key="controls_videocall" roomId={this.props.room.roomId} />,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (this.state.tombstone) {
|
} else if (this.state.tombstone) {
|
||||||
const replacementRoomId = this.state.tombstone.getContent()['replacement_room'];
|
const replacementRoomId = this.state.tombstone.getContent()['replacement_room'];
|
||||||
|
|
||||||
|
|
|
@ -511,4 +511,8 @@ export const SETTINGS = {
|
||||||
displayName: _td("How fast should messages be downloaded."),
|
displayName: _td("How fast should messages be downloaded."),
|
||||||
default: 3000,
|
default: 3000,
|
||||||
},
|
},
|
||||||
|
"showCallButtonsInComposer": {
|
||||||
|
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue