git ssb

16+

Dominic / patchbay



Commit 937c17f654fecfdf321c68504c55d724b112fb94

Handle errors related to avatars

Charles Lehner committed on 6/27/2016, 7:40:31 PM
Parent: 87c8074aa4e4204124daafeef1575b48aec817e2

Files changed

modules/avatar-image.jschanged
modules/names.jschanged
modules/avatar-image.jsView
@@ -9,9 +9,11 @@
99
1010 exports.avatar_image = function (author) {
1111 var img = h('img', {src: 'http://localhost:7777/img/fallback.png'})
1212 sbot_whoami(function (err, me) {
13+ if (err) return console.error(err)
1314 getAvatar({links: sbot_links}, me.id, author, function (err, avatar) {
15+ if (err) return console.error(err)
1416 if(ref.isBlob(avatar.image))
1517 img.src = 'http://localhost:7777/'+encodeURIComponent(avatar.image)
1618 })
1719 })
modules/names.jsView
@@ -38,10 +38,12 @@
3838 //if they have not been mentioned, fallback
3939 //to patchwork style naming (i.e. self id)
4040 if(!names.length)
4141 return sbot_whoami(function (err, me) {
42+ if (err) return console.error(err)
4243 getAvatar({links: sbot_links}, me.id, id,
4344 function (err, avatar) {
45+ if (err) return console.error(err)
4446 console.log(avatar)
4547 n.textContent = avatar.name
4648 })
4749 })

Built with git-ssb-web