Skip to content

Commit 4dd2f9d

Browse files
authored
Merge pull request #49 from rbajaj1997/master
[Bug Fix] Error on deselecting last cup in project 16
2 parents 773d1f3 + 4664cb0 commit 4dd2f9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drink-water/script.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ smallCups.forEach((cup, idx) => {
1111

1212
function highlightCups(idx) {
1313
if (idx===7 && smallCups[idx].classList.contains("full")) idx--;
14-
if(smallCups[idx].classList.contains('full') && !smallCups[idx].nextElementSibling.classList.contains('full')) {
14+
else if(smallCups[idx].classList.contains('full') && !smallCups[idx].nextElementSibling.classList.contains('full')) {
1515
idx--
1616
}
1717

@@ -46,4 +46,4 @@ function updateBigCup() {
4646
remained.style.visibility = 'visible'
4747
listers.innerText = `${2 - (250 * fullCups / 1000)}L`
4848
}
49-
}
49+
}

0 commit comments

Comments
 (0)