Merge pull request #6980 from matrix-org/t3chguy/fix/19162

This commit is contained in:
Michael Telatynski 2021-10-19 11:14:16 +01:00 committed by GitHub
commit d743e3d1d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -872,6 +872,15 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
params.hs_url, params.is_url,
);
// If the hs url matches then take the hs name we know locally as it is likely prettier
const defaultConfig = SdkConfig.get()["validated_server_config"] as ValidatedServerConfig;
if (defaultConfig && defaultConfig.hsUrl === newState.serverConfig.hsUrl) {
newState.serverConfig.hsName = defaultConfig.hsName;
newState.serverConfig.hsNameIsDifferent = defaultConfig.hsNameIsDifferent;
newState.serverConfig.isDefault = defaultConfig.isDefault;
newState.serverConfig.isNameResolvable = defaultConfig.isNameResolvable;
}
newState.register_client_secret = params.client_secret;
newState.register_session_id = params.session_id;
newState.register_id_sid = params.sid;