From: Kibigo Date: Wed, 1 Mar 2017 06:24:34 +0000 (-0800) Subject: Making the back button a little smarter X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=5f6f7aaa27d165b65c19e1df3e383867570a1bc2;p=mastodon.git Making the back button a little smarter --- 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 () {