git ssb

16+

Dominic / patchbay



Commit 2d581d5e26ada49ca088f855fb0c84c4a6f129c6

informative error for avatar names

Dominic Tarr committed on 3/17/2017, 12:36:47 PM
Parent: da92416fcd8422bf818f5d6ceccfb9ed382cf2d6

Files changed

modules_basic/avatar/name.jschanged
modules_basic/avatar/name.jsView
@@ -8,10 +8,14 @@
88
99 exports.create = function (api) {
1010
1111 return function name (id) {
12- var n = h('span', id ? id.substring(0, 10) : "")
1312
13 + if('string' !== typeof id)
14 + throw new Error('avatar id must be a string')
15 +
16 + var n = h('span', id ? id.substring(0, 10) : JSON.stringify(id))
17 +
1418 //choose the most popular name for this person.
1519 //for anything like this you'll see I have used sbot.links2
1620 //which is the ssb-links plugin. as you'll see the query interface
1721 //is pretty powerful!
@@ -26,4 +30,6 @@
2630 }
2731
2832 }
2933
34 +
35 +

Built with git-ssb-web