diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 532b1f4225..d9ed7d061b 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -84,6 +84,7 @@ import {replaceableComponent} from "../../utils/replaceableComponent"; import RoomListStore from "../../stores/room-list/RoomListStore"; import {RoomUpdateCause} from "../../stores/room-list/models"; import defaultDispatcher from "../../dispatcher/dispatcher"; +import SecurityCustomisations from "../../customisations/Security"; /** constants for MatrixChat.state.view */ export enum Views { @@ -395,7 +396,11 @@ export default class MatrixChat extends React.PureComponent { const crossSigningIsSetUp = cli.getStoredCrossSigningForUser(cli.getUserId()); if (crossSigningIsSetUp) { - this.setStateForNewView({ view: Views.COMPLETE_SECURITY }); + if (SecurityCustomisations.SHOW_ENCRYPTION_SETUP_UI === false) { + this.onLoggedIn(); + } else { + this.setStateForNewView({view: Views.COMPLETE_SECURITY}); + } } else if (await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")) { this.setStateForNewView({ view: Views.E2E_SETUP }); } else { diff --git a/src/customisations/Security.ts b/src/customisations/Security.ts index 96b5b62cdb..e215c5cb24 100644 --- a/src/customisations/Security.ts +++ b/src/customisations/Security.ts @@ -74,8 +74,20 @@ export interface ISecurityCustomisations { catchAccessSecretStorageError?: typeof catchAccessSecretStorageError, setupEncryptionNeeded?: typeof setupEncryptionNeeded, getDehydrationKey?: typeof getDehydrationKey, + + /** + * When false, disables the post-login UI from showing. If there's + * an error during setup, that will be shown to the user. + * + * Note: when this is set to false then the app will assume the user's + * encryption is set up some other way which would circumvent the default + * UI, such as by presenting alternative UI. + */ + SHOW_ENCRYPTION_SETUP_UI?: boolean, // default true } // A real customisation module will define and export one or more of the // customisation points that make up `ISecurityCustomisations`. -export default {} as ISecurityCustomisations; +export default { + SHOW_ENCRYPTION_SETUP_UI: true, +} as ISecurityCustomisations;