Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Apr 5, 2024
1 parent 70c492c commit 7d089c5
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/app/(tabs)/genre/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ function GenreScreen() {
return subGenres;
}

async function filterBySubgenre(filter_name: string) {
async function filterBySubgenre(filterName: string) {
setLoading(true);
setSelectedSubgenre(filter_name);
setSelectedSubgenre(filterName);
if (!genreStoryInfo) {
return [];
}
if (filter_name === 'All') {
if (filterName === 'All') {
const storyIds = await getAllStoryIds(genreStoryInfo);
setGenreStoryIds(storyIds);
} else {
const filteredStoryIds = await findStoryIdsByName(
filter_name,
filterName,
genreStoryInfo,
);
setGenreStoryIds(filteredStoryIds);
Expand All @@ -132,17 +132,6 @@ function GenreScreen() {
}
}

//will be triggered when users click checkboxes, will concat all of these clicked and added to a usestate?
//this concatted array will be passed into filterByToneAndTopic array which will go through, genreStoryInfo, and filter
//out each story based on the array that is passed into this fu
async function filterByToneAndTopic(filters: string[]) {
setLoading(true);
setToneTopicFilters(filters);
if (!genreStoryInfo) {
return [];
}
}

useEffect(() => {
const getGenre = async () => {
const genreStoryPreviewData: GenreStories[] =
Expand Down Expand Up @@ -175,7 +164,7 @@ function GenreScreen() {
setLoading(true);
if (genreStoryIds.length > 0) {
const previews: StoryPreview[] =
await fetchStoryPreviewByIds(genreStoryIds as string[]);
await fetchStoryPreviewByIds(genreStoryIds as any);

const tones: string[] = previews
.reduce((acc: string[], current: StoryPreview) => {
Expand Down

0 comments on commit 7d089c5

Please sign in to comment.