Commit 4085b6135d2bff24ac3c2b0818dedc49e03a87dd
list connected pubs on public sidebar
Matt McKegg committed on 11/3/2016, 3:22:08 PMParent: e4249874689b314078266a74aed30d8d3960e8db
Files changed
modules/public.js | changed |
modules/public.js | ||
---|---|---|
@@ -31,8 +31,9 @@ | ||
31 | 31 | var subscribedChannels = obs_subscribed_channels(id) |
32 | 32 | var loading = computed(subscribedChannels.sync, x => !x) |
33 | 33 | var connectedPeers = obs_connected() |
34 | 34 | var localPeers = obs_local() |
35 | + var connectedPubs = computed([connectedPeers, localPeers], (c, l) => c.filter(x => !l.includes(x))) | |
35 | 36 | var following = obs_following(id) |
36 | 37 | |
37 | 38 | var oldest = Date.now() - (2 * 24 * 60 * 60e3) |
38 | 39 | getFirstMessage(id, (_, msg) => { |
@@ -104,8 +105,23 @@ | ||
104 | 105 | h('div.name', [ avatar_name(id) ]) |
105 | 106 | ]) |
106 | 107 | ]) |
107 | 108 | }) |
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 | + }) | |
108 | 124 | ]) |
109 | 125 | ]), |
110 | 126 | h('div.main', [ |
111 | 127 | feed_summary(getFeed, [ |
@@ -148,9 +164,8 @@ | ||
148 | 164 | |
149 | 165 | function getFeed (opts) { |
150 | 166 | if (opts.lt && opts.lt < oldest) { |
151 | 167 | opts = extend(opts, {lt: parseInt(opts.lt, 10)}) |
152 | - console.log('using old feed', opts) | |
153 | 168 | return pull( |
154 | 169 | sbot_feed(opts), |
155 | 170 | pull.map((msg) => { |
156 | 171 | if (msg.sync) { |
Built with git-ssb-web