Add slashes to end of app links in Welcome (fixes #224)
Signed-off-by: Marquis Kurt <software@marquiskurt.net>
This commit is contained in:
parent
4e8a372234
commit
d3729ee76f
|
@ -392,8 +392,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
||||||
this.setState({ user: newUser });
|
this.setState({ user: newUser });
|
||||||
return "https://" + newUser.split("@")[1];
|
return "https://" + newUser.split("@")[1];
|
||||||
} else {
|
} else {
|
||||||
let newUser = `${user}@${
|
let newUser = `${user}@${this.state.registerBase ?? "mastodon.online"
|
||||||
this.state.registerBase ?? "mastodon.online"
|
|
||||||
}`;
|
}`;
|
||||||
this.setState({ user: newUser });
|
this.setState({ user: newUser });
|
||||||
return (
|
return (
|
||||||
|
@ -404,8 +403,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
||||||
|
|
||||||
// Otherwise, treat them as if they're from the server
|
// Otherwise, treat them as if they're from the server
|
||||||
else {
|
else {
|
||||||
let newUser = `${user}@${
|
let newUser = `${user}@${this.state.registerBase ?? "mastodon.online"
|
||||||
this.state.registerBase ?? "mastodon.online"
|
|
||||||
}`;
|
}`;
|
||||||
this.setState({ user: newUser });
|
this.setState({ user: newUser });
|
||||||
return "https://" + (this.state.registerBase ?? "mastodon.online");
|
return "https://" + (this.state.registerBase ?? "mastodon.online");
|
||||||
|
@ -513,7 +511,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
||||||
authorizeEmergencyLogin() {
|
authorizeEmergencyLogin() {
|
||||||
let redirAddress =
|
let redirAddress =
|
||||||
this.state.defaultRedirectAddress === "desktop"
|
this.state.defaultRedirectAddress === "desktop"
|
||||||
? "hyperspace://hyperspace/app"
|
? "hyperspace://hyperspace/app/"
|
||||||
: this.state.defaultRedirectAddress;
|
: this.state.defaultRedirectAddress;
|
||||||
window.location.href = `${redirAddress}/?code=${this.state.authCode}#/`;
|
window.location.href = `${redirAddress}/?code=${this.state.authCode}#/`;
|
||||||
}
|
}
|
||||||
|
@ -660,8 +658,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
||||||
})
|
})
|
||||||
.catch((err: Error) => {
|
.catch((err: Error) => {
|
||||||
this.props.enqueueSnackbar(
|
this.props.enqueueSnackbar(
|
||||||
`Couldn't authorize ${
|
`Couldn't authorize ${this.state.brandName ?? "Hyperspace"
|
||||||
this.state.brandName ?? "Hyperspace"
|
|
||||||
}: ${err.name}`,
|
}: ${err.name}`,
|
||||||
{ variant: "error" }
|
{ variant: "error" }
|
||||||
);
|
);
|
||||||
|
@ -678,7 +675,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
||||||
redirectToApp() {
|
redirectToApp() {
|
||||||
window.location.href =
|
window.location.href =
|
||||||
window.location.protocol === "hyperspace:"
|
window.location.protocol === "hyperspace:"
|
||||||
? "hyperspace://hyperspace/app"
|
? "hyperspace://hyperspace/app/"
|
||||||
: this.state.redirectAddressIsDynamic
|
: this.state.redirectAddressIsDynamic
|
||||||
? `https://${window.location.host}/#/`
|
? `https://${window.location.host}/#/`
|
||||||
: this.state.defaultRedirectAddress + "/#/";
|
: this.state.defaultRedirectAddress + "/#/";
|
||||||
|
@ -977,8 +974,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
||||||
<div
|
<div
|
||||||
className={classes.root}
|
className={classes.root}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${
|
backgroundImage: `url(${this.state.backgroundUrl ?? "background.png"
|
||||||
this.state.backgroundUrl ?? "background.png"
|
|
||||||
})`,
|
})`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue