Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PostStreamScrubber work for Posts that have top margin #2369

Merged
merged 5 commits into from
Oct 15, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix #1897
  • Loading branch information
w-4 committed Oct 8, 2020
commit 00e6441bd2fb33e7170e499a7b3c91b951d2de19
5 changes: 4 additions & 1 deletion js/src/forum/components/PostStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ export default class PostStream extends Component {
if (time) period = time;
});

this.stream.index = indexFromViewPort !== null ? indexFromViewPort + 1 : 1;
// If indexFromViewPort is null, it means no posts are visible in the
// viewport. This can happen, when drafting a long reply post. In that case
// set the index to the last post.
this.stream.index = indexFromViewPort !== null ? indexFromViewPort + 1 : this.stream.count();
this.stream.visible = visible;
if (period) this.stream.description = dayjs(period).format('MMMM YYYY');
}
Expand Down