git ssb

10+

Matt McKegg / patchwork



Commit 33a48d4a8febf6f3e24bfec414ddd8c70db320e0

display likes on private posts

Matt McKegg committed on 10/29/2016, 2:03:24 PM
Parent: 4bee5e3e26dd4e8a2c51680438fa0df5f11a18e2

Files changed

api/index.jschanged
modules/private.jschanged
styles/message.mcsschanged
api/index.jsView
@@ -51,8 +51,11 @@
5151 },
5252 get_likes: function (id) {
5353 return likeCache.get(id)
5454 },
55 + update_likes: function (msg) {
56 + likeCache.updateFrom(msg)
57 + },
5558 sbot_blobs_add: function (cb) {
5659 return pull(
5760 Hash(function (err, id) {
5861 if(err) return cb(err)
modules/private.jsView
@@ -6,8 +6,9 @@
66 var feed_summary = plugs.first(exports.feed_summary = [])
77 var message_unbox = plugs.first(exports.message_unbox = [])
88 var get_id = plugs.first(exports.get_id = [])
99 var avatar_image_link = plugs.first(exports.avatar_image_link = [])
10 +var update_likes = plugs.first(exports.update_likes = [])
1011
1112 exports.screen_view = function (path, sbot) {
1213 if (path === '/private') {
1314 var id = get_id()
@@ -15,9 +16,14 @@
1516 return feed_summary((opts) => {
1617 return pull(
1718 sbot_log(opts),
1819 loosen(10), // release tight loops if they continue too long (avoid scroll jank)
19- unbox()
20 + unbox(),
21 + pull.through((item) => {
22 + if (item.value) {
23 + update_likes(item)
24 + }
25 + })
2026 )
2127 }, [
2228 message_compose({type: 'post', recps: [], private: true}, {
2329 prepublish: function (msg) {
styles/message.mcssView
@@ -61,8 +61,9 @@
6161 background: linear-gradient(45deg, #859c88, #87d47d);
6262 padding: 5px 8px;
6363 border-radius: 10px;
6464 display: inline-block;
65 + vertical-align: top;
6566 }
6667 }
6768 }
6869

Built with git-ssb-web