From 79a3f725be107dbf7390cf06202c60780de56f55 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 2 Feb 2020 18:29:20 -0600 Subject: [PATCH] fix mail sorting and send fields not being cleared --- static-data/www/mail/mail.js | 11 +++++------ static-data/www/mail/sendmail.js | 5 +++-- tests/runtime-result.txt | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/static-data/www/mail/mail.js b/static-data/www/mail/mail.js index b2809441..a2a15dcd 100755 --- a/static-data/www/mail/mail.js +++ b/static-data/www/mail/mail.js @@ -91,12 +91,12 @@ function openThread(bHash, sender, date, sigBool, pubkey, subjectLine){ messageDisplay.innerText = resp var sigEl = document.getElementById('sigValid') var sigMsg = 'signature' - + // show add unknown contact button if peer is unknown if (sender !== myPub && sigBool){ addUnknownContact.style.display = 'inline' } - + if (sigBool){ sigMsg = 'Good ' + sigMsg sigEl.classList.remove('danger') @@ -233,7 +233,7 @@ function loadInboxEntries(bHash){ else{ subjectLine.innerText = '(' + metadata['subject'] + ')' } - //entry.innerHTML = 'sender ' + resp['meta']['signer'] + ' - ' + resp['meta']['time'] + //entry.innerHTML = 'sender ' + resp['meta']['signer'] + ' - ' + resp['meta']['time'] threadPart.appendChild(entry) entry.appendChild(deleteBtn) entry.appendChild(bHashDisplay) @@ -254,7 +254,7 @@ function loadInboxEntries(bHash){ entry.parentNode.removeChild(entry); deleteMessage(entry.getAttribute('data-hash')) } - + }.bind(bHash)) } @@ -264,7 +264,6 @@ function getInbox(){ } var els = document.getElementsByClassName('threadEntry') var showed = false - var requested = '' for(var i = 0; i < pms.length; i++) { var add = true if (pms[i].trim().length == 0){ @@ -365,7 +364,7 @@ fetch('/mail/getinbox', { }}) .then((resp) => resp.text()) .then(function(data) { - pms = data.split(',').reverse() + pms = data.split(',') if (pms.length > 0){ noInbox.style.display = 'none' } diff --git a/static-data/www/mail/sendmail.js b/static-data/www/mail/sendmail.js index 328f8c22..d24fc21d 100755 --- a/static-data/www/mail/sendmail.js +++ b/static-data/www/mail/sendmail.js @@ -24,7 +24,6 @@ subject = document.getElementById('draftSubject') friendPicker = document.getElementById('friendSelect') function sendMail(toData, message, subject){ - //postData = {"postData": '{"to": "' + to + '", "message": "' + message + '"}'} // galaxy brain postData = {'message': message, 'to': toData, 'type': 'pm', 'encrypt': true, 'meta': JSON.stringify({'subject': subject})} postData = JSON.stringify(postData) sendForm.style.display = 'none' @@ -35,13 +34,15 @@ function sendMail(toData, message, subject){ "content-type": "application/json", "token": webpass }}) - .then((resp) => resp.text()) // Transform the data into json + .then((resp) => resp.text()) // Transform the data into text .then(function(data) { sendForm.style.display = 'block' PNotify.success({ text: 'Queued for sending!' }) to.value = subject.value = messageContent.value = "" + friendPicker.value = "" + subject.value = "" }) } diff --git a/tests/runtime-result.txt b/tests/runtime-result.txt index b9ca3db8..cae42e6a 100644 --- a/tests/runtime-result.txt +++ b/tests/runtime-result.txt @@ -1 +1 @@ -1580635315 \ No newline at end of file +1580689731 \ No newline at end of file