mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Hide Delete Backup button when Secure Backup required
If Secure Backup is required by the HS admin, then this hides the Delete Backup button in Settings to ensure everyone keeps their backup per policy. Part of https://github.com/vector-im/element-web/issues/14954
This commit is contained in:
parent
1932505d3b
commit
fed7ebb6bc
1 changed files with 9 additions and 3 deletions
|
@ -21,6 +21,7 @@ import * as sdk from '../../../index';
|
||||||
import {MatrixClientPeg} from '../../../MatrixClientPeg';
|
import {MatrixClientPeg} from '../../../MatrixClientPeg';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import Modal from '../../../Modal';
|
import Modal from '../../../Modal';
|
||||||
|
import { isSecureBackupRequired } from '../../../utils/WellKnownUtils';
|
||||||
|
|
||||||
export default class KeyBackupPanel extends React.PureComponent {
|
export default class KeyBackupPanel extends React.PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -315,14 +316,19 @@ export default class KeyBackupPanel extends React.PureComponent {
|
||||||
trustedLocally = _t("This backup is trusted because it has been restored on this session");
|
trustedLocally = _t("This backup is trusted because it has been restored on this session");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let deleteBackupButton;
|
||||||
|
if (!isSecureBackupRequired()) {
|
||||||
|
deleteBackupButton = <AccessibleButton kind="danger" onClick={this._deleteBackup}>
|
||||||
|
{_t("Delete Backup")}
|
||||||
|
</AccessibleButton>;
|
||||||
|
}
|
||||||
|
|
||||||
const buttonRow = (
|
const buttonRow = (
|
||||||
<div className="mx_KeyBackupPanel_buttonRow">
|
<div className="mx_KeyBackupPanel_buttonRow">
|
||||||
<AccessibleButton kind="primary" onClick={this._restoreBackup}>
|
<AccessibleButton kind="primary" onClick={this._restoreBackup}>
|
||||||
{restoreButtonCaption}
|
{restoreButtonCaption}
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
<AccessibleButton kind="danger" onClick={this._deleteBackup}>
|
{deleteBackupButton}
|
||||||
{_t("Delete Backup")}
|
|
||||||
</AccessibleButton>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue