diff options
author | David Yip <yipdw@member.fsf.org> | 2018-06-06 23:56:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-06 23:56:48 -0500 |
commit | f8d50a40701f344ea7c2a0e5475bbcbc727ef930 (patch) | |
tree | 0f141460a002d7e654ef681f10cf26dae1c9ffda /app/javascript/flavours/glitch/components/column_header.js | |
parent | 68373e799bc6e289ba6c2ced5d0da376ad1cdb3a (diff) | |
parent | cc396f085d5c706d8d2ddc26af5d551a2d5b9526 (diff) |
Merge pull request #509 from ThibG/glitch-soc/fixes/router-history-navigation
Use history.state to decide whether we should goBack() or go to / (fixes #247)
Diffstat (limited to 'app/javascript/flavours/glitch/components/column_header.js')
-rw-r--r-- | app/javascript/flavours/glitch/components/column_header.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/components/column_header.js b/app/javascript/flavours/glitch/components/column_header.js index bfad6467d..72207637d 100644 --- a/app/javascript/flavours/glitch/components/column_header.js +++ b/app/javascript/flavours/glitch/components/column_header.js @@ -66,10 +66,10 @@ export default class ColumnHeader extends React.PureComponent { handleBackClick = () => { // if history is exhausted, or we would leave mastodon, just go to root. - if (window.history && (window.history.length === 1 || window.history.length === window._mastoInitialHistoryLen)) { - this.context.router.history.push('/'); - } else { + if (window.history.state) { this.context.router.history.goBack(); + } else { + this.context.router.history.push('/'); } } |