Skip to content

Commit

Permalink
Merge pull request #389 from itbel/ib-fix-event-bug
Browse files Browse the repository at this point in the history
Fixed event service issue causing null events to display
  • Loading branch information
itbel committed Jul 19, 2023
2 parents 801e5f0 + 4af05d9 commit 83a6d42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/home/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export default function EventCard({
return (
<TouchableOpacity
accessibilityRole="button"
accessibilityLabel={`Learn more about ${event.name}`}
accessibilityHint={`Navigate to the ${event.name} details screen`}
accessibilityLabel={`Learn more about ${event?.name}`}
accessibilityHint={`Navigate to the ${event?.name} details screen`}
activeOpacity={0.45}
onPress={handlePress}
>
Expand Down
2 changes: 1 addition & 1 deletion src/services/EventsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ export default class EventsService {
?.map((fb) => fb?.pageId)
.filter((pageId) => pageId) as string[]) ?? [];
const events = await getEvents(idsToFetch);
return events as FBEvent[];
return events.filter((event) => Boolean(event)) as FBEvent[];
};
}

0 comments on commit 83a6d42

Please sign in to comment.