Fix well-known login caused by faulty check in federation status

This commit is contained in:
Marquis Kurt 2019-04-29 14:44:05 -04:00
parent 04c784f342
commit 6ed271f349
1 changed files with 10 additions and 4 deletions

View File

@ -137,10 +137,16 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
}
getLoginUser(user: string) {
if (this.state.federates || user.includes("@")) {
let newUser = user;
this.setState({ user: newUser })
return "https://" + newUser.split("@")[1];
if (user.includes("@")) {
if (this.state.federates) {
let newUser = user;
this.setState({ user: newUser });
return "https://" + newUser.split("@")[1];
} else {
let newUser = `${user}@${this.state.registerBase? this.state.registerBase: "mastodon.social"}`;
this.setState({ user: newUser });
return "https://" + (this.state.registerBase? this.state.registerBase: "mastodon.social");
}
} else {
let newUser = `${user}@${this.state.registerBase? this.state.registerBase: "mastodon.social"}`;
this.setState({ user: newUser });