From 9f6414d1c71e10a8dff31cf48e4ac64c188080c4 Mon Sep 17 00:00:00 2001 From: KyrneDev Date: Fri, 19 Feb 2021 17:24:55 -0800 Subject: [PATCH] Add comment --- js/src/forum/components/PostStreamScrubber.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/src/forum/components/PostStreamScrubber.js b/js/src/forum/components/PostStreamScrubber.js index ac0010c4c..06ea8d848 100644 --- a/js/src/forum/components/PostStreamScrubber.js +++ b/js/src/forum/components/PostStreamScrubber.js @@ -37,6 +37,10 @@ export default class PostStreamScrubber extends Component { const index = this.stream.index; const previousIndex = this.stream.previousIndex; + // We want to make sure the back button isn't crammed in. + // If the previous post index is less than 5% from the last/first post, + // or if the previous post index is less than 25% from the current post, we will + // hide the button. Additionally, this hides the button on very short screens. const showBackButton = previousIndex > count / 20 && previousIndex < count - count / 20 && 100 * Math.abs((index - previousIndex) / count) > 25; const unreadCount = this.stream.discussion.unreadCount();