Skip to content

Commit

Permalink
timeout for submit notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Tkaixiang committed Jan 2, 2022
1 parent 14807fb commit f173156
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions client/src/Challenges/challengesTagSort.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ class ChallengesTagSort extends React.Component {
message: 'Challenge Solved! Congratulations!',
description:
'Congratulations on solving "' + this.state.viewingChallengeDetails.name + '".',
duration: 0
duration: 5
});
this.setState({ challengeModal: false })
this.props.history.push("/Challenges/" + this.props.category)
Expand All @@ -433,7 +433,7 @@ class ChallengesTagSort extends React.Component {
message: 'Oops. Incorrect Flag',
description:
'It seems like you submitted an incorrect flag "' + values.flag + '" for "' + this.state.viewingChallengeDetails.name + '".',
duration: 0
duration: 3
});
}
}
Expand All @@ -443,47 +443,47 @@ class ChallengesTagSort extends React.Component {
message: 'Oops. Attempts Exhausted',
description:
'It seems like you have execeeded the maximum number of attempts for "' + this.state.viewingChallengeDetails.name + '". Contact an admin if you need more tries.',
duration: 0
duration: 3
});
}
else if (data.error === "submitted") {
notification["error"]({
message: 'Challenge already solved.',
description:
'Your teammate might have already solved the challenge. Please refresh the page to see the latest solve status.',
duration: 0
duration: 3
});
}
else if (data.error === "admin-hidden") {
notification["error"]({
message: 'The challenge is hidden.',
description:
'Submission has been disabled as this challenge is hidden even for admins. This is to prevent challenge leakages.',
duration: 0
duration: 3
});
}
else if (data.error === "required-challenge-not-completed") {
notification["error"]({
message: 'Oops. Required challenge not completed',
description:
'It seems like you have not completed the required challenge before doing this challenge.',
duration: 0
duration: 3
});
}
else if (data.error === "required-challenge-not-found") {
notification["error"]({
message: 'Oops. Required challenge was not found',
description:
'This is likely an error in the challenge settings. Please contact an admin.',
duration: 0
duration: 3
});
}
else if (data.error === "submission-disabled") {
notification["error"]({
message: 'Oops. Submission is disabled',
description:
'New flag submissions have been disabled. The competition might have ended/is not running.',
duration: 0
duration: 3
});
}
else {
Expand Down

0 comments on commit f173156

Please sign in to comment.