Device manager - silence call ringers when local notifications are silenced (#9420)

* silence call ringers when local notifications are silenced

* more coverage for silencing

* explain disabled silence button

* lint

* increase wait for modal

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Kerry 2022-10-17 11:16:04 +02:00 committed by GitHub
parent 1d1860842e
commit 2d9f828810
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 280 additions and 8 deletions

View file

@ -85,6 +85,12 @@ export default class IncomingLegacyCallToast extends React.Component<IProps, ISt
const call = this.props.call;
const room = MatrixClientPeg.get().getRoom(LegacyCallHandler.instance.roomIdForCall(call));
const isVoice = call.type === CallType.Voice;
const callForcedSilent = LegacyCallHandler.instance.isForcedSilent();
let silenceButtonTooltip = this.state.silenced ? _t("Sound on") : _t("Silence call");
if (callForcedSilent) {
silenceButtonTooltip = _t("Notifications silenced");
}
const contentClass = classNames("mx_IncomingLegacyCallToast_content", {
"mx_IncomingLegacyCallToast_content_voice": isVoice,
@ -128,8 +134,9 @@ export default class IncomingLegacyCallToast extends React.Component<IProps, ISt
</div>
<AccessibleTooltipButton
className={silenceClass}
disabled={callForcedSilent}
onClick={this.onSilenceClick}
title={this.state.silenced ? _t("Sound on") : _t("Silence call")}
title={silenceButtonTooltip}
/>
</React.Fragment>;
}