Commit 1be1564d9a05ca401019091795be8867a1aa1111
show user blogs and posts on their userShow page
mix irving committed on 10/17/2017, 12:10:18 AMParent: 23c8bbd3f9f930a0a1fb464a50c47d9218e80173
Files changed
app/page/userShow.js | changed |
app/page/userShow.mcss | changed |
app/page/userShow.js | ||
---|---|---|
@@ -12,12 +12,10 @@ | ||
12 | 12 | 'app.html.blogCard': 'first', |
13 | 13 | 'contact.async.follow': 'first', |
14 | 14 | 'contact.async.unfollow': 'first', |
15 | 15 | 'contact.obs.followers': 'first', |
16 | - 'feed.pull.private': 'first', | |
17 | - 'feed.pull.rollup': 'first', | |
16 | + 'sbot.pull.userFeed': 'first', | |
18 | 17 | 'keys.sync.id': 'first', |
19 | - 'state.obs.threads': 'first', | |
20 | 18 | 'translations.sync.strings': 'first', |
21 | 19 | }) |
22 | 20 | |
23 | 21 | exports.create = (api) => { |
@@ -57,23 +55,17 @@ | ||
57 | 55 | const Link = api.app.html.link |
58 | 56 | const userEditButton = Link({ page: 'userEdit', feed }, h('i.fa.fa-pencil')) |
59 | 57 | const directMessageButton = Link({ page: 'threadNew', feed }, h('Button', strings.userShow.action.directMessage)) |
60 | 58 | |
61 | - const threads = MutantArray() | |
59 | + const BLOG_TYPES = ['blog', 'post'] | |
60 | + const blogs = MutantArray() | |
62 | 61 | pull( |
63 | 62 | // next(api.feed.pull.private, {reverse: true, limit: 100, live: false}, ['value', 'timestamp']), |
64 | 63 | // api.feed.pull.private({reverse: true, limit: 100, live: false}), |
65 | - api.feed.pull.private({reverse: true, live: false}), | |
66 | - pull.filter(msg => { | |
67 | - const recps = get(msg, 'value.content.recps') | |
68 | - if (!recps) return | |
69 | - | |
70 | - return recps | |
71 | - .map(r => typeof r === 'object' ? r.link : r) | |
72 | - .includes(feed) | |
73 | - }), | |
74 | - api.feed.pull.rollup(), | |
75 | - pull.drain(threads.push) | |
64 | + api.sbot.pull.userFeed({id: feed, reverse: true, live: false}), | |
65 | + pull.filter(msg => BLOG_TYPES.includes(get(msg, 'value.content.type'))), | |
66 | + pull.filter(msg => get(msg, 'value.content.root') === undefined), | |
67 | + pull.drain(blogs.push) | |
76 | 68 | // Scroller(content, scrollerContent, render, false, false) |
77 | 69 | ) |
78 | 70 | |
79 | 71 | return h('Page -userShow', {title: name}, [ |
@@ -92,9 +84,9 @@ | ||
92 | 84 | h('div.directMessage', directMessageButton) |
93 | 85 | ]) |
94 | 86 | : '', |
95 | 87 | ]), |
96 | - h('section.blogs', map(threads, api.app.html.blogCard)) | |
88 | + h('section.blogs', map(blogs, api.app.html.blogCard)) | |
97 | 89 | ]) |
98 | 90 | ]) |
99 | 91 | } |
100 | 92 | } |
Built with git-ssb-web