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

Commit

Permalink
Merge pull request #3092 from matrix-org/jryans/full-mxid-default-hs
Browse files Browse the repository at this point in the history
Clear the login busy state after .well-known discovery
  • Loading branch information
jryans authored Jun 11, 2019
2 parents f07aff2 + 2109905 commit 3836a3e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/structures/auth/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ module.exports = React.createClass({
const doWellknownLookup = username[0] === "@";
this.setState({
username: username,
busy: doWellknownLookup, // unset later by the result of onServerConfigChange
busy: doWellknownLookup,
errorText: null,
canTryLogin: true,
});
Expand All @@ -250,6 +250,16 @@ module.exports = React.createClass({
try {
const result = await AutoDiscoveryUtils.validateServerName(serverName);
this.props.onServerConfigChange(result);
// We'd like to rely on new props coming in via `onServerConfigChange`
// so that we know the servers have definitely updated before clearing
// the busy state. In the case of a full MXID that resolves to the same
// HS as Riot's default HS though, there may not be any server change.
// To avoid this trap, we clear busy here. For cases where the server
// actually has changed, `_initLoginLogic` will be called and manages
// busy state for its own liveness check.
this.setState({
busy: false,
});
} catch (e) {
console.error("Problem parsing URL or unhandled error doing .well-known discovery:", e);

Expand Down

0 comments on commit 3836a3e

Please sign in to comment.