From 3c6429aba86f218f15703e2d010105102d402f48 Mon Sep 17 00:00:00 2001 From: Augustus D'Souza Date: Tue, 10 May 2016 07:22:20 +0530 Subject: [PATCH] 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 --- js/forum/src/components/PostStreamScrubber.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/forum/src/components/PostStreamScrubber.js b/js/forum/src/components/PostStreamScrubber.js index a6b7ade71..52636dc75 100644 --- a/js/forum/src/components/PostStreamScrubber.js +++ b/js/forum/src/components/PostStreamScrubber.js @@ -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: {retain || formatNumber(Math.ceil(this.index + this.visible))}, + index: {retain || formatNumber(Math.min(Math.ceil(this.index + this.visible), count))}, count: {formatNumber(count)} });