summaryrefslogtreecommitdiffstats
path: root/dist/js/messaging.js
diff options
context:
space:
mode:
Diffstat (limited to 'dist/js/messaging.js')
-rw-r--r--dist/js/messaging.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/dist/js/messaging.js b/dist/js/messaging.js
index f829cd5..34963a3 100644
--- a/dist/js/messaging.js
+++ b/dist/js/messaging.js
@@ -375,15 +375,18 @@ function displayData(messageType) {
// -1 = cumulative
function getNumMessages(messageType = -1) {
- if (messageType === -1) {
- let sum = 0;
- for (const [messageType, messageList] of Object.entries(messages)) {
- sum += messageList.length;
- }
- return sum;
- } else {
- return (messages[messageType].length ?? 0);
- }
+ if (messageType === -1) {
+ let sum = 0;
+ for (const [messageType, messageList] of Object.entries(messages)) {
+ sum += messageList.length;
+ }
+ return sum;
+ } else {
+ var what_to_return = messages[messageType].length;
+ if(what_to_return == null)
+ return 0
+ return what_to_return;
+ }
}
async function sendMessage(recipient_number, subject, body) {