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

Commit 20a4f0a

Browse files
committed
Enforce config setting
1 parent 3d89fc3 commit 20a4f0a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/structures/MatrixChat.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -956,12 +956,14 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
956956
this.showScreen("welcome");
957957
return;
958958
}
959+
const isMobileRegistrationAllowed =
960+
isMobileRegistration && SettingsStore.getValue("Registration.mobileRegistrationHelper");
959961

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

964-
if (isMobileRegistration && params.hs_url) {
966+
if (isMobileRegistrationAllowed && params.hs_url) {
965967
try {
966968
const config = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(params.hs_url);
967969
newState.serverConfig = config;
@@ -990,12 +992,12 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
990992
newState.register_id_sid = params.sid;
991993
}
992994

993-
newState.isMobileRegistration = isMobileRegistration; //&& SettingsStore.getValue("Registration.mobileRegistrationHelper");
995+
newState.isMobileRegistration = isMobileRegistrationAllowed;
994996

995997
this.setStateForNewView(newState);
996998
ThemeController.isLogin = true;
997999
this.themeWatcher.recheck();
998-
this.notifyNewScreen(isMobileRegistration ? "mobile_register" : "register");
1000+
this.notifyNewScreen(isMobileRegistrationAllowed ? "mobile_register" : "register");
9991001
}
10001002

10011003
// switch view to the given room

0 commit comments

Comments
 (0)