From 04bea0c9d62f8258c07859cbfc837f9707b804bb Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 1 Jun 2016 17:52:57 -0400 Subject: [PATCH] FIX: More last read position fixes --- app/assets/javascripts/discourse/controllers/topic.js.es6 | 2 +- app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index 0a56160bb..f3ab828c1 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -865,7 +865,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { } }); - if (highestReadPostId > 0) { + if (highestReadPostId > 0 && highestReadPostId > (topic.get('last_read_post_id') || 0)) { topic.set('last_read_post_id', highestReadPostId); } diff --git a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 index 851de634e..d881c8d93 100644 --- a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 @@ -120,7 +120,7 @@ createWidget('timeline-scrollarea', { if (lastReadId && lastReadNumber) { const idx = postStream.get('stream').indexOf(lastReadId) + 1; - result.lastRead = lastReadNumber; + result.lastRead = idx; result.lastReadPercentage = this._percentFor(topic, idx); }