git ssb

2+

mixmix / ticktack



Commit 51182f00266ed98dce8a438372451c49940eaa36

fix userShow scroller (was using wrong index property)

mix irving committed on 12/8/2017, 5:54:57 AM
Parent: 9b70108d00646124112662ec83dd9733d7afca7d

Files changed

app/html/scroller.jschanged
app/page/userShow.jschanged
app/html/scroller.jsView
@@ -16,17 +16,18 @@
1616 function createScroller (opts = {}) {
1717 const {
1818 stream,
1919 filter = () => pull.filter((msg) => true),
20+ indexProperty = ['value', 'timestamp']
2021 } = opts
2122
2223 const streamToTop = pull(
23- next(stream, {old: false, limit: 100, property: ['value', 'timestamp']}),
24+ next(stream, {old: false, limit: 100, property: indexProperty }),
2425 filter() // is a pull-stream through
2526 )
2627
2728 const streamToBottom = pull(
28- next(stream, {reverse: true, limit: 100, live: false, property: ['value', 'timestamp']}),
29+ next(stream, {reverse: true, limit: 100, live: false, property: indexProperty }),
2930 filter()
3031 )
3132
3233 return Scroller(Object.assign({}, opts, { streamToTop, streamToBottom }))
app/page/userShow.jsView
@@ -19,8 +19,9 @@
1919 'feed.pull.profile': 'first',
2020 'feed.pull.rollup': 'first',
2121 'message.html.markdown': 'first',
2222 'keys.sync.id': 'first',
23+ 'sbot.pull.userFeed': 'first',
2324 'translations.sync.strings': 'first',
2425 'unread.sync.isUnread': 'first'
2526 })
2627
@@ -74,19 +75,29 @@
7475 : '',
7576 ]),
7677 ]
7778
79+ const store = MutantArray()
80+ // store(console.log)
81+
7882 return h('Page -userShow', [
7983 api.app.html.context(location),
8084 api.app.html.scroller({
8185 classList: ['content'],
8286 prepend,
83- stream: api.feed.pull.profile(feed),
87+ // stream: api.feed.pull.profile(feed),
88+ stream: opts => api.sbot.pull.userFeed(Object.assign({}, { id: feed }, opts)),
89+ indexProperty: ['value', 'sequence'],
8490 filter: () => pull(
91+ // pull.filter(msg => get(msg, 'value.author') === feed),
92+ pull.filter(msg => typeof msg.value.content !== 'string'),
8593 pull.filter(msg => get(msg, 'value.content.root') === undefined),
8694 pull.filter(msg => BLOG_TYPES.includes(get(msg, 'value.content.type')))
8795 ),
88- render: api.app.html.blogCard
96+ render: blog => {
97+ return api.app.html.blogCard(blog)
98+ },
99+ store
89100 })
90101 ])
91102 }
92103 }

Built with git-ssb-web