diff options
author | Ev Bogue <ev@evbogue.com> | 2019-11-23 19:26:47 -0600 |
---|---|---|
committer | Ev Bogue <ev@evbogue.com> | 2019-11-23 19:26:47 -0600 |
commit | 06a7740326eebda9076a1b4538defbf0a351a209 (patch) | |
tree | 5674d0a694bd3687b2073d906f7dd684e5b0405d | |
parent | 88f681bb7d3b86b6d3af6af9d124ef3c008730d4 (diff) |
only call quickname on button press
-rw-r--r-- | render.js | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -123,16 +123,18 @@ function render (msg, keys, preview) { h('a', {href: '#' + msg.reply}, [msg.reply.substring(0, 10) + '...']) ])) } - quickName(msg.author).then(name => { + //quickName(msg.author).then(name => { message.appendChild(h('div',{id: 'content:' + msg.key, innerHTML: marked(msg.text)})) if (!preview) { message.appendChild(h('button', { onclick: function () { - if (messageDiv.firstChild) { - messageDiv.insertBefore(h('div', {classList: 'submessage'}, [composer(keys, msg, name)]), messageDiv.childNodes[1]) - } else { - messageDiv.appendChild(h('div', {classList: 'submessage'}, [composer(keys, msg, name)])) - } + quickName(msg.author).then(name => { + if (messageDiv.firstChild) { + messageDiv.insertBefore(h('div', {classList: 'submessage'}, [composer(keys, msg, name)]), messageDiv.childNodes[1]) + } else { + messageDiv.appendChild(h('div', {classList: 'submessage'}, [composer(keys, msg, name)])) + } + }) } }, ['Reply'])) if (msg.author === keys.publicKey) { @@ -144,7 +146,7 @@ function render (msg, keys, preview) { }, ['Edit'])) } } - }) + //}) } else if (msg.type == 'name') { var mini = h('span', [' identified ', h('a', {href: '#' + msg.named }, [msg.named.substring(0, 10) + '...']), ' as ' + msg.name]) message.appendChild(getHeader(msg, keys, mini)) |