git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit c57e834c351ebc843cc933402c6d24b4184c48ab

add progress to local peer sync, move connected pubs up in sidebar

Matt McKegg committed on 3/13/2017, 2:36:47 AM
Parent: 6a197b12680504c06ada2bc4d50241dabc1cf032

Files changed

modules/page/html/render/public.jschanged
modules/page/html/render/public.jsView
@@ -146,26 +146,10 @@
146146 ])
147147 }, {maxTime: 5})
148148 ]),
149149
150- when(computed(localPeers, x => x.length), h('h2', 'Local')),
151- h('div', {
152- classList: 'ProfileList'
153- }, [
154- map(localPeers, (id) => {
155- return h('a.profile', {
156- classList: [
157- when(computed([connectedPeers, id], (p, id) => p.includes(id)), '-connected')
158- ],
159- href: id
160- }, [
161- h('div.avatar', [api.about.html.image(id)]),
162- h('div.main', [
163- h('div.name', [ '@', api.about.obs.name(id) ])
164- ])
165- ])
166- })
167- ]),
150+ PeerList(localPeers, 'Local'),
151+ PeerList(connectedPubs, 'Connected Pubs'),
168152
169153 when(computed(whoToFollow, x => x.length), h('h2', 'Who to follow')),
170154 when(following.sync,
171155 h('div', {
@@ -182,15 +166,19 @@
182166 ])
183167 })
184168 ]),
185169 h('div', {classList: 'Loading'})
186- ),
170+ )
171+ ]
172+ }
187173
188- when(computed(connectedPubs, x => x.length), h('h2', 'Connected Pubs')),
174+ function PeerList (ids, title) {
175+ return [
176+ when(computed(ids, x => x.length), h('h2', title)),
189177 h('div', {
190178 classList: 'ProfileList'
191179 }, [
192- map(connectedPubs, (id) => {
180+ map(ids, (id) => {
193181 return h('a.profile', {
194182 classList: [ '-connected' ],
195183 href: id
196184 }, [

Built with git-ssb-web