Commit c57e834c351ebc843cc933402c6d24b4184c48ab
add progress to local peer sync, move connected pubs up in sidebar
Matt McKegg committed on 3/13/2017, 2:36:47 AMParent: 6a197b12680504c06ada2bc4d50241dabc1cf032
Files changed
modules/page/html/render/public.js | changed |
modules/page/html/render/public.js | ||
---|---|---|
@@ -146,26 +146,10 @@ | ||
146 | 146 | ]) |
147 | 147 | }, {maxTime: 5}) |
148 | 148 | ]), |
149 | 149 | |
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'), | |
168 | 152 | |
169 | 153 | when(computed(whoToFollow, x => x.length), h('h2', 'Who to follow')), |
170 | 154 | when(following.sync, |
171 | 155 | h('div', { |
@@ -182,15 +166,19 @@ | ||
182 | 166 | ]) |
183 | 167 | }) |
184 | 168 | ]), |
185 | 169 | h('div', {classList: 'Loading'}) |
186 | - ), | |
170 | + ) | |
171 | + ] | |
172 | + } | |
187 | 173 | |
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)), | |
189 | 177 | h('div', { |
190 | 178 | classList: 'ProfileList' |
191 | 179 | }, [ |
192 | - map(connectedPubs, (id) => { | |
180 | + map(ids, (id) => { | |
193 | 181 | return h('a.profile', { |
194 | 182 | classList: [ '-connected' ], |
195 | 183 | href: id |
196 | 184 | }, [ |
Built with git-ssb-web