Add fix for trying to increment solves when solves are hidden (#1646)

* Don't attempt to increment solves if solves are hidden.
This commit is contained in:
Kevin Chung
2020-09-13 02:27:56 -04:00
committed by GitHub
parent ba26722407
commit dfe4f004f2
3 changed files with 18 additions and 11 deletions

View File

@@ -168,15 +168,22 @@ function renderSubmissionResponse(response) {
);
result_notification.slideDown();
$(".challenge-solves").text(
parseInt(
$(".challenge-solves")
.text()
.split(" ")[0]
) +
1 +
" Solves"
);
if (
$(".challenge-solves")
.text()
.trim()
) {
// Only try to increment solves if the text isn't hidden
$(".challenge-solves").text(
parseInt(
$(".challenge-solves")
.text()
.split(" ")[0]
) +
1 +
" Solves"
);
}
answer_input.val("");
answer_input.removeClass("wrong");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long