fixed mail bugs where one couldn't add contact

This commit is contained in:
Kevin Froman 2019-11-21 03:18:16 -06:00
parent 720efe4fca
commit 54a35a452a
2 changed files with 2 additions and 9 deletions

View File

@ -51,7 +51,7 @@ function openReply(bHash, quote, subject){
} }
} }
if (entry.getAttribute('data-nameset') == 'true'){ if (entry.getAttribute('data-nameset') == 'true'){
document.getElementById('friendSelect').value = entry.getElementsByTagName('input')[0].value document.getElementById('friendSelect').value = document.getElementById('fromUser').value
} }
key = entry.getAttribute('data-pubkey') key = entry.getAttribute('data-pubkey')
document.getElementById('draftID').value = key document.getElementById('draftID').value = key
@ -86,6 +86,7 @@ function openThread(bHash, sender, date, sigBool, pubkey, subjectLine){
.then((resp) => resp.text()) .then((resp) => resp.text())
.then(function(resp) { .then(function(resp) {
document.getElementById('fromUser').value = sender || 'Anonymous' document.getElementById('fromUser').value = sender || 'Anonymous'
document.getElementById('fromUser').value = pubkey || ''
document.getElementById('subjectView').innerText = subjectLine document.getElementById('subjectView').innerText = subjectLine
messageDisplay.innerText = resp messageDisplay.innerText = resp
var sigEl = document.getElementById('sigValid') var sigEl = document.getElementById('sigValid')

View File

@ -51,14 +51,6 @@ friendPicker.onchange = function(){
} }
sendForm.onsubmit = function(){ sendForm.onsubmit = function(){
if (friendPicker.value.trim().length !== 0 && to.value.trim().length !== 0){
if (friendPicker.value !== to.value){
PNotify.error({
text: 'You have selected both a friend and entered a public key manually.'
})
return false
}
}
if (! to.value.includes("-") && to.value.length !== 56 && to.value.length !== 52){ if (! to.value.includes("-") && to.value.length !== 56 && to.value.length !== 52){
PNotify.error({ PNotify.error({
text: 'User ID is not valid' text: 'User ID is not valid'