Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Enforce config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
langleyd committed Sep 16, 2024
1 parent 3d89fc3 commit 20a4f0a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -956,12 +956,14 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
this.showScreen("welcome");
return;
}
const isMobileRegistrationAllowed =
isMobileRegistration && SettingsStore.getValue("Registration.mobileRegistrationHelper");

const newState: Partial<IState> = {
view: Views.REGISTER,
};

if (isMobileRegistration && params.hs_url) {
if (isMobileRegistrationAllowed && params.hs_url) {
try {
const config = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(params.hs_url);
newState.serverConfig = config;
Expand Down Expand Up @@ -990,12 +992,12 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
newState.register_id_sid = params.sid;
}

newState.isMobileRegistration = isMobileRegistration; //&& SettingsStore.getValue("Registration.mobileRegistrationHelper");
newState.isMobileRegistration = isMobileRegistrationAllowed;

this.setStateForNewView(newState);
ThemeController.isLogin = true;
this.themeWatcher.recheck();
this.notifyNewScreen(isMobileRegistration ? "mobile_register" : "register");
this.notifyNewScreen(isMobileRegistrationAllowed ? "mobile_register" : "register");
}

// switch view to the given room
Expand Down

0 comments on commit 20a4f0a

Please sign in to comment.