Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Submission review count shows with none submissions #2273

Conversation

flacial
Copy link
Member

@flacial flacial commented Sep 8, 2022

Closes #2208

Merging this PR will stop the submissions review count from being displayed if there's no submissions.

Before:

image

After:

image

To test it:

  1. Go to /curriculum
  2. Notice how it doesn't show for some of the lessons

@vercel
Copy link

vercel bot commented Sep 8, 2022

@flacial is attempting to deploy a commit to the c0d3-prod Team on Vercel.

A member of the Team first needs to authorize it.

@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #2273 (d9dc26e) into master (ab249a9) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #2273   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          177       177           
  Lines         3031      3029    -2     
  Branches       803       806    +3     
=========================================
- Hits          3031      3029    -2     
Impacted Files Coverage Δ
components/LessonCard.tsx 100.00% <100.00%> (ø)

@flacial flacial added the small small things label Sep 8, 2022
@vercel
Copy link

vercel bot commented Sep 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
c0d3-app ✅ Ready (Inspect) Visit Preview Sep 10, 2022 at 2:27PM (UTC)

}
return acc
}, 0)
const submissions = get(data, 'submissions') || []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont have to do || [] ourselves, lodash provides third parameter for that use case

const submissions = get(data, 'submissions', [])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lesson submissions-to-review badge 0 submissions
4 participants