mail UI fixes

master
Kevin Froman 2019-09-10 11:55:44 -05:00
parent f99ff27006
commit 3277192bc7
2 changed files with 62 additions and 45 deletions

View File

@ -77,11 +77,18 @@ function openReply(bHash, quote, subject){
function openThread(bHash, sender, date, sigBool, pubkey, subjectLine){
addUnknownContact.style.display = 'none'
var messageDisplay = document.getElementById('threadDisplay')
var blockContent = httpGet('/getblockbody/' + bHash)
//var blockContent = httpGet('/getblockbody/' + bHash)
fetch('/getblockbody/' + bHash, {
"method": "get",
headers: {
"token": webpass
}})
.then((resp) => resp.text())
.then(function(resp) {
document.getElementById('fromUser').value = sender || 'Anonymous'
document.getElementById('subjectView').innerText = subjectLine
messageDisplay.innerText = blockContent
messageDisplay.innerText = resp
var sigEl = document.getElementById('sigValid')
var sigMsg = 'signature'
@ -111,6 +118,7 @@ function openThread(bHash, sender, date, sigBool, pubkey, subjectLine){
}
addContact(pubkey, friendName)
}
})
}
function setActiveTab(tabName){
@ -139,7 +147,7 @@ function deleteMessage(bHash){
headers: {
"token": webpass
}})
.then((resp) => resp.text()) // Transform the data into json
.then((resp) => resp.text())
.then(function(resp) {
})
}
@ -185,17 +193,25 @@ function loadInboxEntries(bHash){
humanDate.setUTCSeconds(resp['meta']['time'])
humanDate = humanDate.toString()
validSig.style.display = 'none'
if (typeof resp['meta']['signer'] != 'undefined' && resp['meta']['signer'] != ''){
let name = httpGet('/friends/getinfo/' + resp['meta']['signer'] + '/name')
if (name.length == 0){
fetch('/friends/getinfo/' + resp['meta']['signer'] + '/name', {
headers: {
"token": webpass
}})
.then(function(resp2){
if (!resp2.ok){
setHumanReadableValue(senderInput, resp['meta']['signer'])
entry.setAttribute('data-nameSet', false)
}
else{
resp2 => resp2.text()
loadHumanReadableToCache(resp['meta']['signer'])
senderInput.value = name
senderInput.value = resp2
entry.setAttribute('data-nameSet', true)
}
})
}
else{
senderInput.value = 'Anonymous'
@ -347,7 +363,7 @@ fetch('/mail/getinbox', {
headers: {
"token": webpass
}})
.then((resp) => resp.text()) // Transform the data into json
.then((resp) => resp.text())
.then(function(data) {
pms = data.split(',').reverse()
if (pms.length > 0){

View File

@ -15,7 +15,8 @@ function setHumanReadableValue(el, key){
return
}
else{
setTimeout(function(){setHumanReadableValue(el, key)})
loadHumanReadableToCache(key)
setTimeout(function(){setHumanReadableValue(el, key)}, 100)
return
}
}