Add ability to hide post-login encryption setup with customisation point
This is primarily intended for alternative setup UI or where the customisations end up configuring encryption some other way. If used without respecting the warnings in the docs, the user could end up at a blank page - use with caution, and only as directed.
This commit is contained in:
parent
6e6a26f86a
commit
4ef3d176d9
2 changed files with 24 additions and 2 deletions
|
@ -28,6 +28,7 @@ import {
|
|||
} from '../../../stores/SetupEncryptionStore';
|
||||
import SetupEncryptionBody from "./SetupEncryptionBody";
|
||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||
import SecurityCustomisations from "../../../customisations/Security";
|
||||
|
||||
@replaceableComponent("structures.auth.CompleteSecurity")
|
||||
export default class CompleteSecurity extends React.Component {
|
||||
|
@ -45,6 +46,13 @@ export default class CompleteSecurity extends React.Component {
|
|||
|
||||
_onStoreUpdate = () => {
|
||||
const store = SetupEncryptionStore.sharedInstance();
|
||||
|
||||
// Skip "you're done" phase if the UI isn't shown
|
||||
if (store.phase === PHASE_DONE && SecurityCustomisations.SHOW_ENCRYPTION_SETUP_UI === false) {
|
||||
this.props.onFinished(true);
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({phase: store.phase});
|
||||
};
|
||||
|
||||
|
@ -61,7 +69,9 @@ export default class CompleteSecurity extends React.Component {
|
|||
let icon;
|
||||
let title;
|
||||
|
||||
if (phase === PHASE_LOADING) {
|
||||
// If the encryption UI is hidden then we can simply return nothing - the UI doesn't
|
||||
// need to be running in order to set up encryption with the SecurityCustomisations.
|
||||
if (phase === PHASE_LOADING || SecurityCustomisations.SHOW_ENCRYPTION_SETUP_UI === false) {
|
||||
return null;
|
||||
} else if (phase === PHASE_INTRO) {
|
||||
icon = <span className="mx_CompleteSecurity_headerIcon mx_E2EIcon_warning" />;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue