From 178f3b822e1767f34c81a10e0586bf790eb14ab5 Mon Sep 17 00:00:00 2001
From: Robin Ward <robin.ward@gmail.com>
Date: Wed, 18 May 2016 17:26:13 -0400
Subject: [PATCH] FIX: Don't show "Go Back" at the bottom of the timeline

---
 app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6
index f8983ec3d..4cf67cd20 100644
--- a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6
+++ b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6
@@ -133,7 +133,7 @@ createWidget('timeline-scrollarea', {
     ];
 
 
-    if (position.lastRead) {
+    if (position.lastRead && position.lastRead < attrs.topic.posts_count) {
       const lastReadTop = Math.round(position.lastReadPercentage * SCROLLAREA_HEIGHT);
       if (lastReadTop > (before + SCROLLER_HEIGHT)) {
         result.push(this.attach('timeline-last-read', { top: lastReadTop, lastRead: position.lastRead }));