diff --git a/frontend/src/components/BookSelector.tsx b/frontend/src/components/BookSelector.tsx index 1edceef8..df4d3184 100644 --- a/frontend/src/components/BookSelector.tsx +++ b/frontend/src/components/BookSelector.tsx @@ -30,11 +30,11 @@ const BookSelector: React.FC = ({ books, onBookSelect, format if (response.ok) { const data = await response.json(); - const bookFavorites = new Set( - data.favorites - .filter((fav: any) => !fav.chapter) // Only book-level favorites - .map((fav: any) => fav.book) - ); + const favoriteBooks: string[] = data.favorites + .filter((fav: any) => !fav.chapter) // Only book-level favorites + .map((fav: any) => fav.book); + + const bookFavorites = new Set(favoriteBooks); setFavorites(bookFavorites); } } catch (error) { diff --git a/frontend/src/components/ChapterSelector.tsx b/frontend/src/components/ChapterSelector.tsx index f48ef70c..f59fb893 100644 --- a/frontend/src/components/ChapterSelector.tsx +++ b/frontend/src/components/ChapterSelector.tsx @@ -36,11 +36,11 @@ const ChapterSelector: React.FC = ({ book, onChapterSelect if (response.ok) { const data = await response.json(); - const chapterFavorites = new Set( - data.favorites - .filter((fav: any) => fav.book === book && fav.chapter && !fav.verse_start) // Only chapter-level favorites for this book - .map((fav: any) => fav.chapter) - ); + const favoriteChapters: string[] = data.favorites + .filter((fav: any) => fav.book === book && fav.chapter && !fav.verse_start) // Only chapter-level favorites for this book + .map((fav: any) => fav.chapter); + + const chapterFavorites = new Set(favoriteChapters); setFavorites(chapterFavorites); } } catch (error) {