git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit 4085b6135d2bff24ac3c2b0818dedc49e03a87dd

list connected pubs on public sidebar

Matt McKegg committed on 11/3/2016, 3:22:08 PM
Parent: e4249874689b314078266a74aed30d8d3960e8db

Files changed

modules/public.jschanged
modules/public.jsView
@@ -31,8 +31,9 @@
3131 var subscribedChannels = obs_subscribed_channels(id)
3232 var loading = computed(subscribedChannels.sync, x => !x)
3333 var connectedPeers = obs_connected()
3434 var localPeers = obs_local()
35+ var connectedPubs = computed([connectedPeers, localPeers], (c, l) => c.filter(x => !l.includes(x)))
3536 var following = obs_following(id)
3637
3738 var oldest = Date.now() - (2 * 24 * 60 * 60e3)
3839 getFirstMessage(id, (_, msg) => {
@@ -104,8 +105,23 @@
104105 h('div.name', [ avatar_name(id) ])
105106 ])
106107 ])
107108 })
109+ ]),
110+
111+ when(computed(connectedPubs, x => x.length), h('h2', 'Connected Pubs')),
112+ h('ProfileList', [
113+ MutantMap(connectedPubs, (id) => {
114+ return h('a.profile', {
115+ classList: [ '-connected' ],
116+ href: `#${id}`
117+ }, [
118+ h('div.avatar', [avatar_image(id)]),
119+ h('div.main', [
120+ h('div.name', [ avatar_name(id) ])
121+ ])
122+ ])
123+ })
108124 ])
109125 ]),
110126 h('div.main', [
111127 feed_summary(getFeed, [
@@ -148,9 +164,8 @@
148164
149165 function getFeed (opts) {
150166 if (opts.lt && opts.lt < oldest) {
151167 opts = extend(opts, {lt: parseInt(opts.lt, 10)})
152- console.log('using old feed', opts)
153168 return pull(
154169 sbot_feed(opts),
155170 pull.map((msg) => {
156171 if (msg.sync) {

Built with git-ssb-web