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