This commit is contained in:
Untone 2024-01-15 13:50:43 +03:00
parent 0988926a85
commit d789ffc1cd

View File

@ -145,7 +145,7 @@ export const Expo = (props: Props) => {
} }
return ( return (
<div class={styles.Expo}> <div class={styles.Expo}>
<Show when={sortedArticles().length > 0} fallback={<Loading />}> <Show when={sortedArticles()?.length > 0} fallback={<Loading />}>
<div class="wide-container"> <div class="wide-container">
<ul class={clsx('view-switcher')}> <ul class={clsx('view-switcher')}>
<li class={clsx({ 'view-switcher__item--selected': !props.layout })}> <li class={clsx({ 'view-switcher__item--selected': !props.layout })}>
@ -210,7 +210,7 @@ export const Expo = (props: Props) => {
</div> </div>
)} )}
</For> </For>
<Show when={randomTopMonthArticles().length > 0} keyed={true}> <Show when={randomTopMonthArticles()?.length > 0} keyed={true}>
<ArticleCardSwiper title={t('Top month articles')} slides={randomTopMonthArticles()} /> <ArticleCardSwiper title={t('Top month articles')} slides={randomTopMonthArticles()} />
</Show> </Show>
<For each={sortedArticles().slice(PRERENDERED_ARTICLES_COUNT / 2, PRERENDERED_ARTICLES_COUNT)}> <For each={sortedArticles().slice(PRERENDERED_ARTICLES_COUNT / 2, PRERENDERED_ARTICLES_COUNT)}>
@ -225,7 +225,7 @@ export const Expo = (props: Props) => {
</div> </div>
)} )}
</For> </For>
<Show when={randomTopArticles().length > 0} keyed={true}> <Show when={randomTopArticles()?.length > 0} keyed={true}>
<ArticleCardSwiper title={t('Favorite')} slides={randomTopArticles()} /> <ArticleCardSwiper title={t('Favorite')} slides={randomTopArticles()} />
</Show> </Show>
<For each={pages()}> <For each={pages()}>