Skip to content

A platform for community discussion. Free, open, simple.

FIX: Check `postStream.gaps` exists before trying `postSteam.gaps.after`

David Taylor0ebe5ec1f801
diff --git a/app/assets/javascripts/discourse/lib/screen-track.js.es6 b/app/assets/javascripts/discourse/lib/screen-track.js.es6
index bc2d63de4d0..a36b15cb219 100644
--- a/app/assets/javascripts/discourse/lib/screen-track.js.es6
+++ b/app/assets/javascripts/discourse/lib/screen-track.js.es6
@@ -115,6 +115,7 @@ export default class {
!stream.canAppendMore && // We are at the end of the stream
stream.posts.lastObject && // The last post exists
stream.posts.lastObject.read && // The last post is read
+ stream.gaps && // The stream has gaps
!!stream.gaps.after[stream.posts.lastObject.id] && // Stream ends with a gap
stream.topic.last_read_post_number !==
stream.posts.lastObject.post_number +