gpt-engineer-app[bot] 1 tydzień temu
rodzic
commit
f6079bd09b
2 zmienionych plików z 4 dodań i 4 usunięć
  1. 1 1
      src/hooks/useFeedArticles.tsx
  2. 3 3
      src/hooks/useRealArticles.tsx

+ 1 - 1
src/hooks/useFeedArticles.tsx

@@ -86,7 +86,7 @@ export function useFeedArticles(feedId: string, page: number = 1) {
           description: article.description || '',
           content: article.content || '',
           source: article.feeds.name,
-          category: article.feeds.type as NewsItem['category'],
+          category: (article.feeds.type?.startsWith('rss') ? 'rss' : article.feeds.type) as NewsItem['category'],
           publishedAt: article.published_at,
           readTime: article.read_time || 5,
           isPinned: user ? (article.user_articles[0]?.is_pinned || false) : false,

+ 3 - 3
src/hooks/useRealArticles.tsx

@@ -132,7 +132,7 @@ export function useRealArticles(dateFilter?: 'today' | 'yesterday' | null, showF
             description: article.description || '',
             content: article.content || '',
             source: article.feeds.name,
-            category: article.feeds.type as NewsItem['category'],
+            category: (article.feeds.type?.startsWith('rss') ? 'rss' : article.feeds.type) as NewsItem['category'],
             publishedAt: article.published_at,
             readTime: article.read_time || 5,
             isPinned: article.user_articles?.[0]?.is_pinned || false,
@@ -192,7 +192,7 @@ export function useRealArticles(dateFilter?: 'today' | 'yesterday' | null, showF
           content: article.content || '',
           publishedAt: article.published_at,
           source: article.feeds.name,
-          category: article.feeds.type as 'rss' | 'youtube' | 'steam' | 'actualites',
+          category: (article.feeds.type?.startsWith('rss') ? 'rss' : article.feeds.type) as 'rss' | 'youtube' | 'steam' | 'actualites',
           url: article.url || '',
           imageUrl: article.image_url,
           isPinned: false,
@@ -272,7 +272,7 @@ export function useRealArticles(dateFilter?: 'today' | 'yesterday' | null, showF
             description: article.description || '',
             content: article.content || '',
             source: article.feeds.name,
-            category: article.feeds.type as NewsItem['category'],
+            category: (article.feeds.type?.startsWith('rss') ? 'rss' : article.feeds.type) as NewsItem['category'],
             publishedAt: article.published_at,
             readTime: article.read_time || 5,
             isPinned: user ? (article.user_articles?.[0]?.is_pinned || false) : false,