git ssb

10+

Matt McKegg / patchwork



Commit dada655d48da0b7c97d7025d424cad81f4649e60

fix loading display for "who to follow" and "friends"

Matt McKegg committed on 2/17/2017, 2:18:01 AM
Parent: b2f193dcfd24e9aae4e6ce5010c909b026e2e662

Files changed

modules/page/html/render/profile.jschanged
modules/page/html/render/public.jschanged
modules/page/html/render/profile.jsView
@@ -31,11 +31,9 @@
3131 var yourId = api.keys.sync.id()
3232 var yourFollows = api.contact.obs.following(yourId)
3333 var rawFollowers = api.contact.obs.followers(id)
3434 var rawFollowing = api.contact.obs.following(id)
35- var doneWaiting = Value(false)
36- setTimeout(() => doneWaiting.set(true), 1e3)
37- var friendsLoaded = computed([rawFollowers, rawFollowing, doneWaiting], (...x) => x.every(Boolean))
35 + var friendsLoaded = computed([rawFollowers.sync, rawFollowing.sync], (...x) => x.every(Boolean))
3836
3937 var friends = computed([rawFollowing, rawFollowers], (following, followers) => {
4038 return Array.from(following).filter(follow => followers.has(follow))
4139 })
modules/page/html/render/public.jsView
@@ -153,22 +153,25 @@
153153 })
154154 ]),
155155
156156 when(computed(whoToFollow, x => x.length), h('h2', 'Who to follow')),
157- h('div', {
158- classList: 'ProfileList'
159- }, [
160- map(whoToFollow, (id) => {
161- return h('a.profile', {
162- href: id
163- }, [
164- h('div.avatar', [api.about.html.image(id)]),
165- h('div.main', [
166- h('div.name', [ '@', api.about.obs.name(id) ])
157 + when(following.sync,
158 + h('div', {
159 + classList: 'ProfileList'
160 + }, [
161 + map(whoToFollow, (id) => {
162 + return h('a.profile', {
163 + href: id
164 + }, [
165 + h('div.avatar', [api.about.html.image(id)]),
166 + h('div.main', [
167 + h('div.name', [ '@', api.about.obs.name(id) ])
168 + ])
167169 ])
168- ])
169- })
170- ]),
170 + })
171 + ]),
172 + h('div', {classList: 'Loading'})
173 + ),
171174
172175 when(computed(connectedPubs, x => x.length), h('h2', 'Connected Pubs')),
173176 h('div', {
174177 classList: 'ProfileList'

Built with git-ssb-web