fix mail sorting and send fields not being cleared

master
Kevin Froman 2020-02-02 18:29:20 -06:00
parent 5c3fb5bec3
commit 79a3f725be
3 changed files with 9 additions and 9 deletions

View File

@ -264,7 +264,6 @@ function getInbox(){
} }
var els = document.getElementsByClassName('threadEntry') var els = document.getElementsByClassName('threadEntry')
var showed = false var showed = false
var requested = ''
for(var i = 0; i < pms.length; i++) { for(var i = 0; i < pms.length; i++) {
var add = true var add = true
if (pms[i].trim().length == 0){ if (pms[i].trim().length == 0){
@ -365,7 +364,7 @@ fetch('/mail/getinbox', {
}}) }})
.then((resp) => resp.text()) .then((resp) => resp.text())
.then(function(data) { .then(function(data) {
pms = data.split(',').reverse() pms = data.split(',')
if (pms.length > 0){ if (pms.length > 0){
noInbox.style.display = 'none' noInbox.style.display = 'none'
} }

View File

@ -24,7 +24,6 @@ subject = document.getElementById('draftSubject')
friendPicker = document.getElementById('friendSelect') friendPicker = document.getElementById('friendSelect')
function sendMail(toData, message, subject){ 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 = {'message': message, 'to': toData, 'type': 'pm', 'encrypt': true, 'meta': JSON.stringify({'subject': subject})}
postData = JSON.stringify(postData) postData = JSON.stringify(postData)
sendForm.style.display = 'none' sendForm.style.display = 'none'
@ -35,13 +34,15 @@ function sendMail(toData, message, subject){
"content-type": "application/json", "content-type": "application/json",
"token": webpass "token": webpass
}}) }})
.then((resp) => resp.text()) // Transform the data into json .then((resp) => resp.text()) // Transform the data into text
.then(function(data) { .then(function(data) {
sendForm.style.display = 'block' sendForm.style.display = 'block'
PNotify.success({ PNotify.success({
text: 'Queued for sending!' text: 'Queued for sending!'
}) })
to.value = subject.value = messageContent.value = "" to.value = subject.value = messageContent.value = ""
friendPicker.value = ""
subject.value = ""
}) })
} }

View File

@ -1 +1 @@
1580635315 1580689731