From 6fc26283bde78a53b6e111e600a57ea529f7cbb8 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Mon, 14 Nov 2022 11:03:48 +0300 Subject: [PATCH] fix-ackee-increment --- src/components/Article/FullArticle.tsx | 10 ---------- src/components/Pages/LayoutShoutsPage.tsx | 8 +++----- src/components/Views/Home.tsx | 6 ------ src/main.astro | 5 +++++ 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index fa78d1f8..ab6d6b07 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -67,18 +67,8 @@ export const FullArticle = (props: ArticleProps) => { } }) - //
diff --git a/src/components/Pages/LayoutShoutsPage.tsx b/src/components/Pages/LayoutShoutsPage.tsx index ebe178fc..7f0282b2 100644 --- a/src/components/Pages/LayoutShoutsPage.tsx +++ b/src/components/Pages/LayoutShoutsPage.tsx @@ -29,7 +29,7 @@ export const LayoutShoutsPage = (props: PageProps) => { }) const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false) const { sortedLayoutShouts } = useLayoutsStore(layout(), props.shouts) - const sortedArticles = createMemo(() => sortedLayoutShouts().get(layout())) + const sortedArticles = createMemo(() => sortedLayoutShouts().get(layout()) || []) const loadMoreLayout = async (kind: LayoutType) => { saveScrollPosition() @@ -59,12 +59,11 @@ export const LayoutShoutsPage = (props: PageProps) => { const pages = createMemo(() => splitToPages(sortedArticles(), PRERENDERED_ARTICLES_COUNT, LOAD_MORE_PAGE_SIZE) ) - const [isLoaded, setIsLoaded] = createSignal(Boolean(props.shouts)) + const isLoaded = createMemo(() => Boolean(sortedArticles())) onMount(async () => { if (!isLoaded()) { await loadRecentLayoutShouts({ layout: layout(), amount: PRERENDERED_ARTICLES_COUNT, offset: 0 }) - setIsLoaded(true) } }) @@ -102,9 +101,8 @@ export const LayoutShoutsPage = (props: PageProps) => { }>
- +

{title()}

- diff --git a/src/components/Views/Home.tsx b/src/components/Views/Home.tsx index f3d91c39..d1246a86 100644 --- a/src/components/Views/Home.tsx +++ b/src/components/Views/Home.tsx @@ -110,12 +110,6 @@ export const HomeView = (props: HomeProps) => { return ( 0}> - diff --git a/src/main.astro b/src/main.astro index 63b790e0..d5df3176 100644 --- a/src/main.astro +++ b/src/main.astro @@ -16,6 +16,11 @@ setLocale(lang) {t('Discours')} +