From fed7ebb6bc3a9549b62cedaa94041d220a7c5605 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 17 Aug 2020 16:00:30 +0100 Subject: [PATCH] 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 --- src/components/views/settings/KeyBackupPanel.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/views/settings/KeyBackupPanel.js b/src/components/views/settings/KeyBackupPanel.js index a7a2c768db..8a74276f58 100644 --- a/src/components/views/settings/KeyBackupPanel.js +++ b/src/components/views/settings/KeyBackupPanel.js @@ -21,6 +21,7 @@ import * as sdk from '../../../index'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; +import { isSecureBackupRequired } from '../../../utils/WellKnownUtils'; export default class KeyBackupPanel extends React.PureComponent { 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"); } + let deleteBackupButton; + if (!isSecureBackupRequired()) { + deleteBackupButton = + {_t("Delete Backup")} + ; + } + const buttonRow = (
{restoreButtonCaption}     - - {_t("Delete Backup")} - + {deleteBackupButton}
);