Fix edge case of landing on 3pid email link with registration disabled (#12771)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-07-15 11:02:23 +01:00 committed by GitHub
parent 3221f7cade
commit 2e0b5bb462
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -551,7 +551,10 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
.then((loadedSession) => { .then((loadedSession) => {
if (!loadedSession) { if (!loadedSession) {
// fall back to showing the welcome screen... unless we have a 3pid invite pending // fall back to showing the welcome screen... unless we have a 3pid invite pending
if (ThreepidInviteStore.instance.pickBestInvite()) { if (
ThreepidInviteStore.instance.pickBestInvite() &&
SettingsStore.getValue(UIFeature.Registration)
) {
dis.dispatch({ action: "start_registration" }); dis.dispatch({ action: "start_registration" });
} else { } else {
dis.dispatch({ action: "view_welcome_page" }); dis.dispatch({ action: "view_welcome_page" });
@ -951,6 +954,11 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
} }
private async startRegistration(params: { [key: string]: string }): Promise<void> { private async startRegistration(params: { [key: string]: string }): Promise<void> {
if (!SettingsStore.getValue(UIFeature.Registration)) {
this.showScreen("welcome");
return;
}
const newState: Partial<IState> = { const newState: Partial<IState> = {
view: Views.REGISTER, view: Views.REGISTER,
}; };