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 });
|
||||
return "https://" + newUser.split("@")[1];
|
||||
} else {
|
||||
let newUser = `${user}@${
|
||||
this.state.registerBase ?? "mastodon.online"
|
||||
let newUser = `${user}@${this.state.registerBase ?? "mastodon.online"
|
||||
}`;
|
||||
this.setState({ user: newUser });
|
||||
return (
|
||||
|
@ -404,8 +403,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
|||
|
||||
// Otherwise, treat them as if they're from the server
|
||||
else {
|
||||
let newUser = `${user}@${
|
||||
this.state.registerBase ?? "mastodon.online"
|
||||
let newUser = `${user}@${this.state.registerBase ?? "mastodon.online"
|
||||
}`;
|
||||
this.setState({ user: newUser });
|
||||
return "https://" + (this.state.registerBase ?? "mastodon.online");
|
||||
|
@ -513,7 +511,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
|||
authorizeEmergencyLogin() {
|
||||
let redirAddress =
|
||||
this.state.defaultRedirectAddress === "desktop"
|
||||
? "hyperspace://hyperspace/app"
|
||||
? "hyperspace://hyperspace/app/"
|
||||
: this.state.defaultRedirectAddress;
|
||||
window.location.href = `${redirAddress}/?code=${this.state.authCode}#/`;
|
||||
}
|
||||
|
@ -660,8 +658,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
|||
})
|
||||
.catch((err: Error) => {
|
||||
this.props.enqueueSnackbar(
|
||||
`Couldn't authorize ${
|
||||
this.state.brandName ?? "Hyperspace"
|
||||
`Couldn't authorize ${this.state.brandName ?? "Hyperspace"
|
||||
}: ${err.name}`,
|
||||
{ variant: "error" }
|
||||
);
|
||||
|
@ -678,7 +675,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
|||
redirectToApp() {
|
||||
window.location.href =
|
||||
window.location.protocol === "hyperspace:"
|
||||
? "hyperspace://hyperspace/app"
|
||||
? "hyperspace://hyperspace/app/"
|
||||
: this.state.redirectAddressIsDynamic
|
||||
? `https://${window.location.host}/#/`
|
||||
: this.state.defaultRedirectAddress + "/#/";
|
||||
|
@ -977,8 +974,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
|||
<div
|
||||
className={classes.root}
|
||||
style={{
|
||||
backgroundImage: `url(${
|
||||
this.state.backgroundUrl ?? "background.png"
|
||||
backgroundImage: `url(${this.state.backgroundUrl ?? "background.png"
|
||||
})`,
|
||||
}}
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue