Skip to content

Commit

Permalink
πŸ› fix empty state rendering logic in UserEventsList component (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronheard authored Jan 5, 2025
1 parent c7418ff commit b9b354a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions apps/expo/src/components/UserEventsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,9 @@ export default function UserEventsList(props: UserEventsListProps) {
const collapsedEvents = collapseSimilarEvents(events, user?.id);

const renderEmptyState = () => {
if (isAddingEvent && events.length === 0) {
if (isAddingEvent && collapsedEvents.length === 0) {
return (
<View className="flex-1">
{stats && <EventStats {...stats} />}
<EventListItemSkeleton />
</View>
);
Expand Down Expand Up @@ -426,10 +425,6 @@ export default function UserEventsList(props: UserEventsListProps) {

const renderHeader = () => (stats ? <EventStats {...stats} /> : null);

if (collapsedEvents.length === 0 && !isAddingEvent) {
return renderEmptyState();
}

return (
<>
<FlatList
Expand Down

0 comments on commit b9b354a

Please sign in to comment.