Skip to content

Commit

Permalink
Better use of challenge prop
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgasper committed Jul 8, 2024
1 parent 0c347e9 commit f316902
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/shared/components/challenge-detail/Submissions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ class SubmissionsComponent extends React.Component {
*/
getInitialScore(submission) {
let score = 'N/A';
const { challenge } = this.props;

if (!_.isEmpty(submission.review)
&& !_.isEmpty(submission.review[0])
&& submission.review[0].score
&& this.challenge.status === 'Completed') {
&& challenge.status === 'Completed') {
score = Number(submission.review[0].score).toFixed(2);
} else if (!_.isEmpty(submission.score)) {
score = Number(submission.score).toFixed(2);
Expand Down

0 comments on commit f316902

Please sign in to comment.