summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-05-20 17:15:14 +0200
committersijanec <sijanecantonluka@gmail.com>2020-05-20 17:15:14 +0200
commit2eaa58fd631705101eeb6a946f548f936747c30e (patch)
treec8a5c00961db8b88fd5a17b8868d56c4857893ea
parentfixed geeky operators (diff)
downloadbeziapp-2eaa58fd631705101eeb6a946f548f936747c30e.tar
beziapp-2eaa58fd631705101eeb6a946f548f936747c30e.tar.gz
beziapp-2eaa58fd631705101eeb6a946f548f936747c30e.tar.bz2
beziapp-2eaa58fd631705101eeb6a946f548f936747c30e.tar.lz
beziapp-2eaa58fd631705101eeb6a946f548f936747c30e.tar.xz
beziapp-2eaa58fd631705101eeb6a946f548f936747c30e.tar.zst
beziapp-2eaa58fd631705101eeb6a946f548f936747c30e.zip
-rw-r--r--assets/js/messaging.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/assets/js/messaging.js b/assets/js/messaging.js
index f829cd5..34963a3 100644
--- a/assets/js/messaging.js
+++ b/assets/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) {