Issue with Nested Infinite Scrolling for Comments in Elgg Activity Page

I'm working on an Elgg plugin and have extended the activity page and comment to include infinite scrolling for comments under each river item. So now there are two levels of infinite scrolling:

  1. One for loading more river items.
  2. Another for loading more comments under each river item.

However, when I click the "Load more" button to load additional river items, I encounter an issue: the comments section under each newly loaded river item displays the following message:

"You have reached a part of the list without any content, however there is content available. Go back to the first page."

This happens even though those river items do have comments.

Do you have any idea why this is happening or how I can resolve it?

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking