mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
fix(feed): fix dementia
This commit is contained in:
parent
35bfe97360
commit
9d75f0b249
3 changed files with 18 additions and 3 deletions
|
@ -24,7 +24,7 @@
|
|||
</div>
|
||||
|
||||
<div class='scroll_container'>
|
||||
<div class='scroll_node' n:foreach='$posts as $post'>
|
||||
<div class='scroll_node' n:foreach='$posts as $post' data-uniqueid="{$post->getPrettyId()}">
|
||||
<a name="postGarter={$post->getId()}"></a>
|
||||
{include "../components/post.xml", post => $post, onWallOf => true, commentSection => true}
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
<div class="content scroll_container">
|
||||
{if sizeof($posts) > 0}
|
||||
<div class='scroll_node' n:foreach='$posts as $post'>
|
||||
<div class='scroll_node' n:foreach='$posts as $post' data-uniqueid="{$post->getPrettyId()}">
|
||||
<a name="postGarter={$post->getId()}"></a>
|
||||
|
||||
{include "../components/post.xml", post => $post, commentSection => true}
|
||||
|
|
|
@ -2335,6 +2335,15 @@ async function __processPaginatorNextPage(page)
|
|||
|
||||
const nodes = parsed_content.querySelectorAll(container_node)
|
||||
nodes.forEach(node => {
|
||||
const unique_id = node.dataset.uniqueid
|
||||
if(unique_id) {
|
||||
const elements_unique = u(`.scroll_node[data-uniqueid='${unique_id}']`).length
|
||||
if(elements_unique > 0) {
|
||||
console.info('AJAX | Found duplicates')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
container.append(node)
|
||||
})
|
||||
|
||||
|
@ -2395,7 +2404,13 @@ const showMoreObserver = new IntersectionObserver(entries => {
|
|||
}
|
||||
|
||||
const page_number = Number(next_page.html())
|
||||
await __processPaginatorNextPage(page_number)
|
||||
|
||||
try {
|
||||
await __processPaginatorNextPage(page_number)
|
||||
} catch(e) {
|
||||
console.error(e)
|
||||
}
|
||||
|
||||
bsdnHydrate()
|
||||
u('.paginator:not(.paginator-at-top)').removeClass('lagged')
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue