Skip to content

Commit 3a593a4

Browse files
committed
Merge pull request #570 from /issues/569/1
Fixes #569: The back arrow should go back to /issues when there's no history
2 parents 65b3537 + 30dbe6f commit 3a593a4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

webcompat/static/js/lib/issues.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ issues.TitleView = Backbone.View.extend({
3131
location.origin = location.protocol + '//' + location.host;
3232
}
3333

34-
// Only go back in history if we came from the /issues page.
35-
if (document.referrer.indexOf(location.origin + '/issues') === 0) {
34+
// Only go back in history if we came from the /issues page and there's
35+
// actually some history to go back to
36+
if ((document.referrer.indexOf(location.origin + '/issues') === 0) &&
37+
(history.length !== 1)) {
3638
history.back();
3739
e.preventDefault();
40+
} else {
41+
location.href = '/issues';
3842
}
3943
}
4044
});

0 commit comments

Comments
 (0)