diff options
author | sijanec <sijanecantonluka@gmail.com> | 2020-05-20 17:15:14 +0200 |
---|---|---|
committer | sijanec <sijanecantonluka@gmail.com> | 2020-05-20 17:15:14 +0200 |
commit | 2eaa58fd631705101eeb6a946f548f936747c30e (patch) | |
tree | c8a5c00961db8b88fd5a17b8868d56c4857893ea /assets | |
parent | fixed geeky operators (diff) | |
download | beziapp-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 |
Diffstat (limited to 'assets')
-rw-r--r-- | assets/js/messaging.js | 21 |
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) { |