Fixes #945 - Incorrect Scrubber count value (#946)

* Fixes #945 - Incorrect Scrubber count value

Clicking and dragging the Scrubber beyond the final post causes the counter to exceed the total post count. This commit fixes that issue.

* Updated post calculating logic
This commit is contained in:
Augustus D'Souza 2016-05-10 07:22:20 +05:30 committed by Franz Liedke
parent 619561cf56
commit 3c6429aba8

View File

@ -61,7 +61,7 @@ export default class PostStreamScrubber extends Component {
const unreadPercent = count ? Math.min(count - this.index, unreadCount) / count : 0;
const viewing = app.translator.transChoice('core.forum.post_scrubber.viewing_text', count, {
index: <span className="Scrubber-index">{retain || formatNumber(Math.ceil(this.index + this.visible))}</span>,
index: <span className="Scrubber-index">{retain || formatNumber(Math.min(Math.ceil(this.index + this.visible), count))}</span>,
count: <span className="Scrubber-count">{formatNumber(count)}</span>
});