diff options
author | Kibigo <marrus-sh@users.noreply.github.com> | 2017-02-28 22:24:34 -0800 |
---|---|---|
committer | Kibigo <marrus-sh@users.noreply.github.com> | 2017-02-28 22:24:34 -0800 |
commit | 5f6f7aaa27d165b65c19e1df3e383867570a1bc2 (patch) | |
tree | a7b023cb3c575d6e8fc1dee00a6fdcda9d1d2fb0 /app/assets | |
parent | 5960bac11ea62f9066b338ecef46733fea85b1f6 (diff) |
Making the back button a little smarter
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/components/components/column_back_button.jsx | 3 |
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 () { |