diff --git a/components/ArticlesList.tsx b/components/ArticlesList.tsx index e393d99..175a4a5 100644 --- a/components/ArticlesList.tsx +++ b/components/ArticlesList.tsx @@ -12,6 +12,7 @@ interface ArticlesListProps { } function LoadingState() { + // Use generic loading message at startup, then specific message once we know what we're loading return (
{t('common.loading.articles')}
diff --git a/components/HomeView.tsx b/components/HomeView.tsx index edddc19..cc9fb4c 100644 --- a/components/HomeView.tsx +++ b/components/HomeView.tsx @@ -9,6 +9,7 @@ import { PageHeader } from '@/components/PageHeader' import { Footer } from '@/components/Footer' import { FundingGauge } from '@/components/FundingGauge' import type { Dispatch, SetStateAction } from 'react' +import { t } from '@/lib/i18n' interface HomeViewProps { searchQuery: string @@ -97,12 +98,19 @@ function HomeContent({ }: HomeViewProps) { const shouldShowFilters = !loading && allArticles.length > 0 const shouldShowAuthors = selectedCategory !== null && selectedCategory !== 'all' - const articlesListProps = { articles, allArticles, loading, error, onUnlock, unlockedArticles } - const authorsListProps = { authors, allAuthors, loading, error } - // Determine loading state: if showing authors, authors are loaded from articles, so loading is the same - // But we need to check if authors are actually being loaded (when no articles yet) - const authorsLoading = loading && shouldShowAuthors && allAuthors.length === 0 + // At startup, we don't know yet if we're loading articles or authors + // Use a generic loading message until we have content + const isInitialLoad = loading && allArticles.length === 0 && allAuthors.length === 0 + const articlesListProps = { + articles, + allArticles, + loading: loading && !isInitialLoad, // Don't show loading if it's the initial generic state + error, + onUnlock, + unlockedArticles + } + const authorsListProps = { authors, allAuthors, loading: loading && !isInitialLoad, error } return ({t('common.loading')}
+