diff options
Diffstat (limited to 'app/javascript/mastodon/components/column_back_button.js')
-rw-r--r-- | app/javascript/mastodon/components/column_back_button.js | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/app/javascript/mastodon/components/column_back_button.js b/app/javascript/mastodon/components/column_back_button.js index bedc417fd..a4971f5f8 100644 --- a/app/javascript/mastodon/components/column_back_button.js +++ b/app/javascript/mastodon/components/column_back_button.js @@ -4,12 +4,11 @@ import PropTypes from 'prop-types'; class ColumnBackButton extends React.PureComponent { - constructor (props, context) { - super(props, context); - this.handleClick = this.handleClick.bind(this); - } + static contextTypes = { + router: PropTypes.object + }; - handleClick () { + handleClick = () => { if (window.history && window.history.length === 1) this.context.router.push("/"); else this.context.router.goBack(); } @@ -23,10 +22,6 @@ class ColumnBackButton extends React.PureComponent { ); } -}; - -ColumnBackButton.contextTypes = { - router: PropTypes.object -}; +} export default ColumnBackButton; |