Merge pull request #3114 from matrix-org/dbkr/allow_server_change_if_dead

Allow changing server if validation has failed
This commit is contained in:
David Baker 2019-06-18 09:37:31 +01:00 committed by GitHub
commit 5e7b4564cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -168,6 +168,8 @@ module.exports = React.createClass({
_replaceClient: async function(serverConfig) { _replaceClient: async function(serverConfig) {
this.setState({ this.setState({
errorText: null, errorText: null,
serverDeadError: null,
serverErrorIsFatal: false,
// busy while we do liveness check (we need to avoid trying to render // busy while we do liveness check (we need to avoid trying to render
// the UI auth component while we don't have a matrix client) // the UI auth component while we don't have a matrix client)
busy: true, busy: true,
@ -429,7 +431,9 @@ module.exports = React.createClass({
// If we're on a different phase, we only show the server type selector, // If we're on a different phase, we only show the server type selector,
// which is always shown if we allow custom URLs at all. // which is always shown if we allow custom URLs at all.
if (PHASES_ENABLED && this.state.phase !== PHASE_SERVER_DETAILS) { // (if there's a fatal server error, we need to show the full server
// config as the user may need to change servers to resolve the error).
if (PHASES_ENABLED && this.state.phase !== PHASE_SERVER_DETAILS && !this.state.serverErrorIsFatal) {
return <div> return <div>
<ServerTypeSelector <ServerTypeSelector
selected={this.state.serverType} selected={this.state.serverType}

View file

@ -104,6 +104,9 @@ export default class ServerConfig extends React.PureComponent {
const stateForError = AutoDiscoveryUtils.authComponentStateForError(e); const stateForError = AutoDiscoveryUtils.authComponentStateForError(e);
if (!stateForError.isFatalError) { if (!stateForError.isFatalError) {
this.setState({
busy: false,
});
// carry on anyway // carry on anyway
const result = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(hsUrl, isUrl, true); const result = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(hsUrl, isUrl, true);
this.props.onServerConfigChange(result); this.props.onServerConfigChange(result);