aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEv Bogue <ev@evbogue.com>2019-04-05 11:02:52 -0500
committerEv Bogue <ev@evbogue.com>2019-04-05 11:02:52 -0500
commit618a88e33b0bc49e7b914a9bd24c8838a8cd8f57 (patch)
treeed773c42df90533d94cb8e7a0ace371db59d6155
parent7ef13425cc2ab2025f78a8f2b967c76403d4e5e4 (diff)
fix a bug where the same message was displayed twice in threading
-rw-r--r--lib.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib.js b/lib.js
index d4dcbbc..572d2da 100644
--- a/lib.js
+++ b/lib.js
@@ -132,20 +132,20 @@ function renderMessage (post) {
if (post.content.type == 'post') {
var log = JSON.parse(localStorage['log'])
+ setTimeout(function () {
for (var i = log.length - 1; i >= 0; --i) {
//console.log(i)
if (log[i].content.reply == post.key) {
- var nextPost = log[i]
- console.log(nextPost)
- setTimeout(function () {
+ var nextPost = log[i]
+ console.log(nextPost)
scroller.appendChild(h('div', {classList: 'submessage'}, [
renderMessage(nextPost)
]))
- }, 100)
+ }
}
- }
+ }, 10)
var renderer = new marked.Renderer();
renderer.link = function(href, title, text) {