Skip to content

Commit e4e1b0a

Browse files
authored
Merge pull request #21 from Countly/WarningForNegativeCount
Warning for Negative Event Count Added
2 parents b1517a1 + 407cff7 commit e4e1b0a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
XX.XX.X
2+
* For events, warning added for the negative count.

events.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ <h4 class="modal-title text-center">Use this snippet to send an event to server<
228228
}
229229

230230
data.count = parseInt($("#event-count").val()) || 1;
231+
if (data.count < 0) {
232+
$("#event-count").parent().prepend('<div class="alert alert-danger" role="alert">Count for event cannot be negative</div>');
233+
scrollToElement(".section");
234+
return;
235+
}
231236

232237
if ($("#event-sum").val() != "") {
233238
data.sum = parseFloat($("#event-sum").val());

0 commit comments

Comments
 (0)