Only show toast about camera in video calls

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-07-22 09:23:37 +02:00
parent 37335b2c79
commit 6429b3c8bd
No known key found for this signature in database
GPG Key ID: 55C211A1226CB17D

View File

@ -593,6 +593,7 @@ export default class CallView extends React.Component<IProps, IState> {
const someoneIsScreensharing = this.props.call.getFeeds().some((feed) => {
return feed.purpose === SDPStreamMetadataPurpose.Screenshare;
});
const isVideoCall = this.props.call.type = CallType.Video;
let contentView: React.ReactNode;
let holdTransferContent;
@ -646,7 +647,7 @@ export default class CallView extends React.Component<IProps, IState> {
if (
(!isOnHold && !transfereeCall) &&
(
(sidebarShown && this.props.call.type === CallType.Video) ||
(sidebarShown && isVideoCall) ||
(someoneIsScreensharing && sidebarShown) ||
isScreensharing
)
@ -663,7 +664,7 @@ export default class CallView extends React.Component<IProps, IState> {
// This is a bit messy. I can't see a reason to have two onHold/transfer screens
if (isOnHold || transfereeCall) {
if (this.props.call.type === CallType.Video) {
if (isVideoCall) {
const containerClasses = classNames({
mx_CallView_content: true,
mx_CallView_video: true,
@ -761,7 +762,7 @@ export default class CallView extends React.Component<IProps, IState> {
let text = isScreensharing
? _t("You are presenting")
: _t('%(sharerName)s is presenting', { sharerName });
if (!this.state.sidebarShown) {
if (!this.state.sidebarShown && isVideoCall) {
text += " • " + (this.props.call.isLocalVideoMuted()
? _t("Your camera is turned off")
: _t("Your camera is still enabled"));
@ -794,7 +795,7 @@ export default class CallView extends React.Component<IProps, IState> {
);
}
const callTypeText = this.props.call.type === CallType.Video ? _t("Video Call") : _t("Voice Call");
const callTypeText = isVideoCall ? _t("Video Call") : _t("Voice Call");
let myClassName;
let fullScreenButton;