[Glitch] Fix “Back” button sometimes redirecting out of Mastodon
Port a442a1d1c6
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -528,11 +528,12 @@ class UI extends Component {
|
||||
};
|
||||
|
||||
handleHotkeyBack = () => {
|
||||
// if history is exhausted, or we would leave mastodon, just go to root.
|
||||
if (window.history.state) {
|
||||
this.props.history.goBack();
|
||||
const { history } = this.props;
|
||||
|
||||
if (history.location?.state?.fromMastodon) {
|
||||
history.goBack();
|
||||
} else {
|
||||
this.props.history.push('/');
|
||||
history.push('/');
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user