about summary refs log tree commit diff
path: root/app/assets/javascripts/components
diff options
context:
space:
mode:
authorKibigo <marrus-sh@users.noreply.github.com>2017-02-28 22:24:34 -0800
committerKibigo <marrus-sh@users.noreply.github.com>2017-02-28 22:24:34 -0800
commit5f6f7aaa27d165b65c19e1df3e383867570a1bc2 (patch)
treea7b023cb3c575d6e8fc1dee00a6fdcda9d1d2fb0 /app/assets/javascripts/components
parent5960bac11ea62f9066b338ecef46733fea85b1f6 (diff)
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 () {