Merge branch 'develop' into t3chguy/wat/230.1
This commit is contained in:
@@ -952,18 +952,20 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
}
|
||||
|
||||
private async startRegistration(params: { [key: string]: string }, isMobileRegistration?: boolean): Promise<void> {
|
||||
if (!SettingsStore.getValue(UIFeature.Registration)) {
|
||||
// If registration is disabled or mobile registration is requested but not enabled in settings redirect to the welcome screen
|
||||
if (
|
||||
!SettingsStore.getValue(UIFeature.Registration) ||
|
||||
(isMobileRegistration && !SettingsStore.getValue("Registration.mobileRegistrationHelper"))
|
||||
) {
|
||||
this.showScreen("welcome");
|
||||
return;
|
||||
}
|
||||
const isMobileRegistrationAllowed =
|
||||
isMobileRegistration && SettingsStore.getValue("Registration.mobileRegistrationHelper");
|
||||
|
||||
const newState: Partial<IState> = {
|
||||
view: Views.REGISTER,
|
||||
};
|
||||
|
||||
if (isMobileRegistrationAllowed && params.hs_url) {
|
||||
if (isMobileRegistration && params.hs_url) {
|
||||
try {
|
||||
const config = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(params.hs_url);
|
||||
newState.serverConfig = config;
|
||||
@@ -992,12 +994,12 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||
newState.register_id_sid = params.sid;
|
||||
}
|
||||
|
||||
newState.isMobileRegistration = isMobileRegistrationAllowed;
|
||||
newState.isMobileRegistration = isMobileRegistration;
|
||||
|
||||
this.setStateForNewView(newState);
|
||||
ThemeController.isLogin = true;
|
||||
this.themeWatcher.recheck();
|
||||
this.notifyNewScreen(isMobileRegistrationAllowed ? "mobile_register" : "register");
|
||||
this.notifyNewScreen(isMobileRegistration ? "mobile_register" : "register");
|
||||
}
|
||||
|
||||
// switch view to the given room
|
||||
|
||||
@@ -1364,7 +1364,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
||||
if (containsEmoji(ev.getContent(), effect.emojis) || ev.getContent().msgtype === effect.msgType) {
|
||||
// For initial threads launch, chat effects are disabled see #19731
|
||||
if (!ev.isRelation(THREAD_RELATION_TYPE.name)) {
|
||||
dis.dispatch({ action: `effects.${effect.command}` });
|
||||
dis.dispatch({ action: `effects.${effect.command}`, event: ev });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -627,6 +627,7 @@ export default class Registration extends React.Component<IProps, IState> {
|
||||
serverConfig={this.props.serverConfig}
|
||||
canSubmit={!this.state.serverErrorIsFatal}
|
||||
matrixClient={this.state.matrixClient}
|
||||
mobileRegister={this.props.mobileRegister}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
@@ -779,7 +780,11 @@ export default class Registration extends React.Component<IProps, IState> {
|
||||
);
|
||||
}
|
||||
if (this.props.mobileRegister) {
|
||||
return <div className="mx_MobileRegister_body">{body}</div>;
|
||||
return (
|
||||
<div className="mx_MobileRegister_body" data-testid="mobile-register">
|
||||
{body}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<AuthPage>
|
||||
|
||||
Reference in New Issue
Block a user