Commit 937c17f654fecfdf321c68504c55d724b112fb94
Handle errors related to avatars
Charles Lehner committed on 6/27/2016, 7:40:31 PMParent: 87c8074aa4e4204124daafeef1575b48aec817e2
Files changed
modules/avatar-image.js | changed |
modules/names.js | changed |
modules/avatar-image.js | ||
---|---|---|
@@ -9,9 +9,11 @@ | ||
9 | 9 | |
10 | 10 | exports.avatar_image = function (author) { |
11 | 11 | var img = h('img', {src: 'http://localhost:7777/img/fallback.png'}) |
12 | 12 | sbot_whoami(function (err, me) { |
13 | + if (err) return console.error(err) | |
13 | 14 | getAvatar({links: sbot_links}, me.id, author, function (err, avatar) { |
15 | + if (err) return console.error(err) | |
14 | 16 | if(ref.isBlob(avatar.image)) |
15 | 17 | img.src = 'http://localhost:7777/'+encodeURIComponent(avatar.image) |
16 | 18 | }) |
17 | 19 | }) |
modules/names.js | ||
---|---|---|
@@ -38,10 +38,12 @@ | ||
38 | 38 | //if they have not been mentioned, fallback |
39 | 39 | //to patchwork style naming (i.e. self id) |
40 | 40 | if(!names.length) |
41 | 41 | return sbot_whoami(function (err, me) { |
42 | + if (err) return console.error(err) | |
42 | 43 | getAvatar({links: sbot_links}, me.id, id, |
43 | 44 | function (err, avatar) { |
45 | + if (err) return console.error(err) | |
44 | 46 | console.log(avatar) |
45 | 47 | n.textContent = avatar.name |
46 | 48 | }) |
47 | 49 | }) |
Built with git-ssb-web