From 17a82cd281a84c41f645b1b5de108ea693fba531 Mon Sep 17 00:00:00 2001 From: Kibigo Date: Tue, 28 Feb 2017 22:24:34 -0800 Subject: [PATCH] Making the back button a little smarter --- .../javascripts/components/components/column_back_button.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/components/components/column_back_button.jsx b/app/assets/javascripts/components/components/column_back_button.jsx index 6abf11239b..6b5ffee53f 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 () {