Commit 2cf1bb74f569e4953eff4eac2b041cae2ca62b6b
Show error loading thread
Charles Lehner authored on 7/2/2016, 5:07:52 PMcel committed on 11/27/2016, 2:05:36 AM
Parent: dea3d20f5c389390227401809a5db4c76f77db09
Files changed
modules_basic/thread.js | changed |
modules_basic/thread.js | ||
---|---|---|
@@ -35,8 +35,9 @@ | ||
35 | 35 … | //in this case, it's inconvienent that panel only takes |
36 | 36 … | //a stream. maybe it would be better to accept an array? |
37 | 37 … | |
38 | 38 … | sbot_get(root, function (err, value) { |
39 … | + if (err) return cb(err) | |
39 | 40 … | var msg = {key: root, value: value} |
40 | 41 … | // if(value.content.root) return getThread(value.content.root, cb) |
41 | 42 … | |
42 | 43 … | pull( |
@@ -87,15 +88,17 @@ | ||
87 | 88 … | //would probably be better keep an id for each message element |
88 | 89 … | //(i.e. message key) and then update it if necessary. |
89 | 90 … | //also, it may have moved (say, if you received a missing message) |
90 | 91 … | content.innerHTML = '' |
92 … | + if(err) return content.appendChild(h('pre', err.stack)) | |
93 … | + | |
91 | 94 … | //decrypt |
92 | 95 … | thread = thread.map(function (msg) { |
93 | 96 … | return 'string' === typeof msg.value.content ? message_unbox(msg) : msg |
94 | 97 … | }) |
95 | 98 … | |
96 | 99 … | if(err) return content.appendChild(h('pre', err.stack)) |
97 | - sort(thread).map(message_render).filter(Boolean).forEach(function (el) { | |
100 … | + sort(thread).map(message_render).forEach(function (el) { | |
98 | 101 … | content.appendChild(el) |
99 | 102 … | }) |
100 | 103 … | |
101 | 104 … | var branches = sort.heads(thread) |
Built with git-ssb-web