about summary refs log tree commit diff
path: root/app/assets/javascripts/components
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-03-01 10:50:27 +0100
committerGitHub <noreply@github.com>2017-03-01 10:50:27 +0100
commit0924eee81baf8f864449b616532589a9213bca57 (patch)
treea7b023cb3c575d6e8fc1dee00a6fdcda9d1d2fb0 /app/assets/javascripts/components
parent5960bac11ea62f9066b338ecef46733fea85b1f6 (diff)
parent5f6f7aaa27d165b65c19e1df3e383867570a1bc2 (diff)
Merge pull request #660 from marrus-sh/mastodon-smart-back-button
#467 – Making the back button a little smarter
Diffstat (limited to 'app/assets/javascripts/components')
-rw-r--r--app/assets/javascripts/components/components/column_back_button.jsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/components/column_back_button.jsx b/app/assets/javascripts/components/components/column_back_button.jsx
index 6abf11239..6b5ffee53 100644
--- a/app/assets/javascripts/components/components/column_back_button.jsx
+++ b/app/assets/javascripts/components/components/column_back_button.jsx
@@ -15,7 +15,8 @@ const ColumnBackButton = React.createClass({
   mixins: [PureRenderMixin],
 
   handleClick () {
-    this.context.router.goBack();
+    if (window.history && window.history.length == 1) this.context.router.push("/");
+    else this.context.router.goBack();
   },
 
   render () {