Skip to content

Commit 5061db9

Browse files
committed
Only show download for MM challenge type, not tag
1 parent b1a0ddf commit 5061db9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/shared/components/challenge-detail/Submissions/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import React from 'react';
77
import PT from 'prop-types';
88
import moment from 'moment';
9-
import { isMM as checkIsMM } from 'utils/challenge';
9+
import { isMM as checkIsMM, isMMByType as checkIsMMByType} from 'utils/challenge';
1010
import _ from 'lodash';
1111
import { connect } from 'react-redux';
1212
import { config } from 'topcoder-react-utils';
@@ -604,7 +604,7 @@ class SubmissionsComponent extends React.Component {
604604
}
605605
{
606606
((numWinners > 0 || challenge.status === CHALLENGE_STATUS.COMPLETED)
607-
&& isMM && isLoggedIn) && (
607+
&& isMMByType(challenge) && isLoggedIn) && (
608608
<div styleName="block-download-all">
609609
<button
610610
disabled={downloadingAll}

src/shared/utils/challenge.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ export function isMM(challenge) {
1313
return tags.includes('Marathon Match') || isMMType;
1414
}
1515

16+
/**
17+
* check if is marathon match challenge by type only (ignore MM tags)
18+
* @param {Object} challenge challenge object
19+
*/
20+
export function isMMByType(challenge) {
21+
const isMMType = challenge ? challenge.type === 'Marathon Match' : false;
22+
return isMMType;
23+
}
1624
/**
1725
* Set challenge type to challenge
1826
* @param {Object} challenges challenge object
@@ -29,5 +37,6 @@ export function updateChallengeType(challenges, challengeTypeMap) {
2937

3038
export default {
3139
isMM,
40+
isMMByType,
3241
updateChallengeType,
3342
};

0 commit comments

Comments
 (0)