git ssb

2+

mixmix / ticktack



Commit 930a234f8e8c982d1f957647399cb38c7eae3dba

improve search loading with feed.pull.channel

mix irving committed on 12/3/2017, 2:23:34 AM
Parent: 680732062c0d08b82953e62e36211cafffa71270

Files changed

app/page/blogSearch.jschanged
app/page/blogSearch.jsView
@@ -9,8 +9,9 @@
99 'app.html.blogCard': 'first',
1010 'app.html.blogNav': 'first',
1111 'app.html.scroller': 'first',
1212 'channel.obs.recent': 'first',
13+ 'feed.pull.channel': 'first',
1314 'feed.pull.public': 'first',
1415 'history.sync.push': 'first',
1516 'keys.sync.id': 'first',
1617 'message.html.channel': 'first',
@@ -55,25 +56,24 @@
5556 }))
5657 )
5758 ])
5859
60+ var createStream = api.feed.pull.public
61+ if (location.channel) createStream = api.feed.pull.channel(location.channel)
62+
5963 var blogs = api.app.html.scroller({
6064 classList: ['content'],
6165 prepend: [
6266 api.app.html.blogNav(location),
6367 searchField
6468 ],
65- stream: api.feed.pull.public,
69+ stream: createStream,
6670 filter: () => pull(
6771 pull.filter(msg => {
6872 const type = msg.value.content.type
6973 return type === 'post' || type === 'blog'
7074 }),
71- pull.filter(msg => !msg.value.content.root), // show only root messages
72- pull.filter(msg => {
73- if (!location.channel) return true
74- return msg.value.content.channel === location.channel
75- })
75+ pull.filter(msg => !msg.value.content.root) // show only root messages
7676 ),
7777 // FUTURE : if we need better perf, we can add a persistent cache. At the moment this page is fast enough though.
7878 // See implementation of app.html.context for example
7979 // store: recentMsgCache,

Built with git-ssb-web