git ssb

30+

cel / git-ssb-web



Commit 51e9718cb367cc06af5a19f5ebafb0887420e957

about: callback early instead of aborting

aborting the stream doesn't seem to work when running as a sbot plugin
Charles Lehner committed on 4/21/2016, 8:28:40 PM
Parent: e2ff84468233c659a81da3317c19bb5e5e0bd932

Files changed

about.jschanged
about.jsView
@@ -62,21 +62,31 @@
6262 pull.filter(function (msg) {
6363 return msg && msg.value.content
6464 }),
6565 pull.drain(function (msg) {
66- if (info.name && info.image) return false
66+ if (info.name && info.image)
67+ return gotIt()
6768 var c = msg.value.content
6869 if (!info.name && c.name)
6970 info.name = c.name
7071 if (!info.image && c.image)
7172 info.image = c.image.link
72- }, function (err) {
73- if (err && err !== true) return cb(err)
74- if (!info.name) info.name = truncate(target, 20)
75- cb(null, info)
76- })
73+ }, gotIt)
7774 )
7875
76+ function gotIt(err) {
77+ if (!cb) {
78+ if (err && err !== true)
79+ console.error(err)
80+ return
81+ }
82+ var _cb = cb
83+ cb = null
84+ if (err && err !== true) return _cb(err)
85+ if (!info.name) info.name = truncate(target, 20)
86+ _cb(null, info)
87+ }
88+
7989 // Keep updated as changes are made
8090 pull(
8191 sbot.links({
8292 dest: target,

Built with git-ssb-web