Commit dada655d48da0b7c97d7025d424cad81f4649e60
fix loading display for "who to follow" and "friends"
Matt McKegg committed on 2/17/2017, 2:18:01 AMParent: b2f193dcfd24e9aae4e6ce5010c909b026e2e662
Files changed
modules/page/html/render/profile.js | changed |
modules/page/html/render/public.js | changed |
modules/page/html/render/profile.js | ||
---|---|---|
@@ -31,11 +31,9 @@ | ||
31 | 31 … | var yourId = api.keys.sync.id() |
32 | 32 … | var yourFollows = api.contact.obs.following(yourId) |
33 | 33 … | var rawFollowers = api.contact.obs.followers(id) |
34 | 34 … | 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)) | |
38 | 36 … | |
39 | 37 … | var friends = computed([rawFollowing, rawFollowers], (following, followers) => { |
40 | 38 … | return Array.from(following).filter(follow => followers.has(follow)) |
41 | 39 … | }) |
modules/page/html/render/public.js | |||
---|---|---|---|
@@ -153,22 +153,25 @@ | |||
153 | 153 … | }) | |
154 | 154 … | ]), | |
155 | 155 … | ||
156 | 156 … | 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 … | + ]) | ||
167 | 169 … | ]) | |
168 | - ]) | ||
169 | - }) | ||
170 | - ]), | ||
170 … | + }) | ||
171 … | + ]), | ||
172 … | + h('div', {classList: 'Loading'}) | ||
173 … | + ), | ||
171 | 174 … | ||
172 | 175 … | when(computed(connectedPubs, x => x.length), h('h2', 'Connected Pubs')), | |
173 | 176 … | h('div', { | |
174 | 177 … | classList: 'ProfileList' |
Built with git-ssb-web