fix: closes #11731, set postIndex on pagination

This commit is contained in:
Barış Soner Uşaklı
2023-06-22 21:16:11 -04:00
parent 777c7d0975
commit cbd98c1b28
4 changed files with 20 additions and 10 deletions

View File

@@ -151,10 +151,8 @@ define('forum/topic', [
const bookmark = ajaxify.data.bookmark || storage.getItem('topic:' + tid + ':bookmark');
const postIndex = ajaxify.data.postIndex;
updateUserBookmark(postIndex);
if (postIndex > 1) {
if (components.get('post/anchor', postIndex - 1).length) {
return navigator.scrollToPostIndex(postIndex - 1, true, 0);
}
if (navigator.shouldScrollToPost(postIndex)) {
return navigator.scrollToPostIndex(postIndex - 1, true, 0);
} else if (bookmark && (
!config.usePagination ||
(config.usePagination && ajaxify.data.pagination.currentPage === 1)