From 9d75f0b2492eb7de1ce8b7041bb1e42ed5ea5958 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Sun, 8 Dec 2024 12:03:32 +0300 Subject: [PATCH] fix(feed): fix dementia --- Web/Presenters/templates/Wall/Feed.xml | 2 +- Web/Presenters/templates/components/wall.xml | 2 +- Web/static/js/al_wall.js | 17 ++++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Web/Presenters/templates/Wall/Feed.xml b/Web/Presenters/templates/Wall/Feed.xml index 94658a81..59d55de3 100644 --- a/Web/Presenters/templates/Wall/Feed.xml +++ b/Web/Presenters/templates/Wall/Feed.xml @@ -24,7 +24,7 @@
-
+
{include "../components/post.xml", post => $post, onWallOf => true, commentSection => true}
diff --git a/Web/Presenters/templates/components/wall.xml b/Web/Presenters/templates/components/wall.xml index b00681a1..8ac45456 100644 --- a/Web/Presenters/templates/components/wall.xml +++ b/Web/Presenters/templates/components/wall.xml @@ -15,7 +15,7 @@
{if sizeof($posts) > 0} -
+
{include "../components/post.xml", post => $post, commentSection => true} diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js index cbab0eaa..132c8e98 100644 --- a/Web/static/js/al_wall.js +++ b/Web/static/js/al_wall.js @@ -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') }