modules/page/html/render/public.jsView |
---|
23 | 23 | 'progress.html.peer': 'first', |
24 | 24 | |
25 | 25 | 'feed.html.rollup': 'first', |
26 | 26 | 'profile.obs.recentlyUpdated': 'first', |
| 27 | + 'profile.obs.contact': 'first', |
27 | 28 | 'contact.obs.following': 'first', |
28 | 29 | 'contact.obs.blocking': 'first', |
29 | 30 | 'channel.obs': { |
30 | 31 | subscribed: 'first', |
56 | 57 | var channels = computed(recentChannels, items => items.slice(0, 8), {comparer: arrayEq}) |
57 | 58 | var connectedPeers = api.sbot.obs.connectedPeers() |
58 | 59 | var localPeers = api.sbot.obs.localPeers() |
59 | 60 | var connectedPubs = computed([connectedPeers, localPeers], (c, l) => c.filter(x => !l.includes(x))) |
| 61 | + var contact = api.profile.obs.contact(id) |
60 | 62 | |
61 | 63 | var prepend = [ |
62 | 64 | api.message.html.compose({ meta: { type: 'post' }, placeholder: i18n('Write a public message') }) |
63 | 65 | ] |
129 | 131 | var result = h('div.SplitView', [ |
130 | 132 | h('div.side', [ |
131 | 133 | getSidebar() |
132 | 134 | ]), |
133 | | - h('div.main', feedView) |
| 135 | + h('div.main', [ |
| 136 | + when( |
| 137 | + computed([contact.isNotFollowingAnybody, loading], (a,b) => a && !b), |
| 138 | + renderNoVisiblePostsWarning() |
| 139 | + ), |
| 140 | + feedView]) |
134 | 141 | ]) |
135 | 142 | |
136 | 143 | result.pendingUpdates = feedView.pendingUpdates |
137 | 144 | result.reload = function () { |
282 | 289 | } |
283 | 290 | } |
284 | 291 | } |
285 | 292 | |
| 293 | +function renderNoVisiblePostsWarning() { |
| 294 | + return h('div', {classList: 'PublicFeed main'}, h('section -notFollowingAnyoneWarning', [ |
| 295 | + h('h1', '⚠️ You are not following anybody.'), |
| 296 | + h('h3', `You may not be able to see new posts and replies.`), |
| 297 | + h('h3', 'You can only see new posts from people you follow, and people that they follow.'), |
| 298 | + h('h3', 'Follow one or more users to see some new posts.') |
| 299 | + ])) |
| 300 | +} |
| 301 | + |
286 | 302 | function getType (msg) { |
287 | 303 | return msg && msg.value && msg.value.content && msg.value.content.type |
288 | 304 | } |
289 | 305 | |