Commit 4578a96e041f3221e1c76fb18c2a8ea3e4da8060
Merge remote-tracking branch 'origin/updates'
Dominic Tarr committed on 11/28/2016, 11:12:13 PMParent: cc06e263225583cc9a1c6958063f600fb97d8968
Parent: 4d24a50832bd54a07cf73adc9707b4adbd33105e
Files changed
modules_basic/message-name.js | changed |
modules_basic/thread.js | changed |
style.css | changed |
modules_basic/message-name.js | |||
---|---|---|---|
@@ -1,10 +1,10 @@ | |||
1 | 1 … | ||
2 | 2 … | var sbot_get = require('../plugs').first(exports.sbot_get = []) | |
3 | 3 … | ||
4 | 4 … | function title (s) { | |
5 | - var m = /^[^\n]{0,40}/.exec(s) | ||
6 | - return m && (m[0].length == 40 ? m[0]+'...' : m[0]) | ||
5 … | + var m = /^\n*([^\n]{0,40})/.exec(s) | ||
6 … | + return m && (m[1].length == 40 ? m[1]+'...' : m[1]) | ||
7 | 7 … | } | |
8 | 8 … | ||
9 | 9 … | exports.message_name = function (id, cb) { | |
10 | 10 … | sbot_get(id, function (err, value) { |
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,8 +88,10 @@ | ||
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 … | }) |
Built with git-ssb-web