git ssb

3+

ev / sdash



Commit 34b07459e5b69b2cfc44f79d97b19f3432c6191d

cache avatar name and image at application start

Ev Bogue committed on 11/1/2016, 4:48:56 AM
Parent: bcd9b355057bf21d39778b30190a37f049748d57

Files changed

index.jschanged
index.jsView
@@ -5,22 +5,25 @@
55 var client = require('ssb-client')
66 var md = require('ssb-markdown')
77 var avatar = require('ssb-avatar')
88 var mo = require('moment')
9-var ref = require('ssb-ref')
9 +// var ref = require('ssb-ref')
1010
1111 var title = 'sdash'
1212 var me = '@8Qee0I/DwI5DHSCi3p5fsl6FyLGArrnDz3ox9qZr5Qc=.ed25519'
1313 var bloburl = 'https://evbogue.com/ws/blobs/get/'
1414
15 +client(function (err, sbot) {
16 + avatar(sbot, me, me, function (err, avatar){
17 + if (err) throw err
18 + name = avatar.name
19 + image = avatar.image
20 + })
21 +})
22 +
1523 http.createServer(function (req, res){
1624 if (req.url === '/') {
1725 client(function (err, sbot) {
18- avatar(sbot, me, me, function (err, avatar){
19- if (err) throw err
20- name = avatar.name
21- image = avatar.image
22- })
2326 pull(
2427 sbot.query.read({query: [{$filter: { value: { author: me, content: {type: 'post'}}}}], limit: 1, reverse: true}),
2528 pull.drain(function (data) {
2629 post = data

Built with git-ssb-web