Skip to content

Commit 8310436

Browse files
authored
Merge pull request #4599 from nursoltan-s/i-4557
fixed my challenges page bug
2 parents c784836 + dea22e7 commit 8310436

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/shared/components/Dashboard/CurrentActivity/Challenges/ChallengeCard/index.jsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ function normalizeSubTrackTagForRendering(subTrack) {
3535
return _.startCase(_.toLower(x));
3636
}
3737

38-
function normalizeSubTrack(subTrack) {
39-
const type = _.upperCase(subTrack);
40-
return type.replace(/ /g, '_');
41-
}
42-
4338
export default function ChallengeCard({
4439
challenge,
4540
selectChallengeDetailsTab,
@@ -57,7 +52,11 @@ export default function ChallengeCard({
5752
type,
5853
} = challenge;
5954

60-
const subTrackId = _.findKey(challengeSubtracksMap, { abbreviation: normalizeSubTrack(type) });
55+
let subTrackId = _.findKey(challengeSubtracksMap, { description: type });
56+
57+
if (!subTrackId) {
58+
subTrackId = _.findKey(challengeSubtracksMap, { description: 'Code' });
59+
}
6160

6261
const { track } = legacy;
6362

@@ -229,7 +228,7 @@ export default function ChallengeCard({
229228
) : null
230229
}
231230
{
232-
submitter && isChallengeOpen ? (
231+
submitter && isChallengeOpen && phaseMessage !== STALLED_MSG ? (
233232
<Button
234233
size="sm"
235234
theme={{ button: style.button }}

src/shared/containers/SubmissionPage.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@ class SubmissionsPageContainer extends React.Component {
3434
getCommunitiesList,
3535
challengeId,
3636
loadChallengeDetails,
37-
challengeName,
3837
} = this.props;
3938

40-
if (!challengeName) {
41-
loadChallengeDetails(auth, challengeId);
42-
}
43-
39+
loadChallengeDetails(auth, challengeId);
4440
getCommunitiesList(auth);
4541
}
4642

0 commit comments

Comments
 (0)