Commit d66efb8ebb52d71d88c8afb1b057bb89452c120f
show compact message when root is a fork
Matt McKegg committed on 11/20/2017, 2:58:11 AMParent: 43227d5b2a248b928fbf666ecdf2f1e54a7ecd4b
Files changed
modules/feed/html/rollup.js | changed |
modules/page/html/render/public.js | changed |
modules/feed/html/rollup.js | ||
---|---|---|
@@ -195,9 +195,9 @@ | ||
195 | 195 | var replies = item.replies.filter(isReply).sort(byAssertedTime) |
196 | 196 | var replyElements = replies.filter(displayFilter).slice(-3).map((msg) => { |
197 | 197 | var result = api.message.html.render(msg, { |
198 | 198 | previousId, |
199 | - compact: compactFilter(msg), | |
199 | + compact: compactFilter(msg, item), | |
200 | 200 | priority: highlightItems.has(msg.key) ? 2 : 0 |
201 | 201 | }) |
202 | 202 | previousId = msg.key |
203 | 203 | return [ |
modules/page/html/render/public.js | ||
---|---|---|
@@ -18,8 +18,9 @@ | ||
18 | 18 | 'invite.sheet': 'first', |
19 | 19 | |
20 | 20 | 'message.html.compose': 'first', |
21 | 21 | 'message.async.publish': 'first', |
22 | + 'message.sync.root': 'first', | |
22 | 23 | 'progress.html.peer': 'first', |
23 | 24 | |
24 | 25 | 'feed.html.rollup': 'first', |
25 | 26 | 'profile.obs.recentlyUpdated': 'first', |
@@ -104,8 +105,14 @@ | ||
104 | 105 | lastMessage = msg |
105 | 106 | return true |
106 | 107 | } |
107 | 108 | }, |
109 | + compactFilter: function (msg, root) { | |
110 | + if (!root && api.message.sync.root(msg)) { | |
111 | + // msg has a root, but is being displayed as root (fork) | |
112 | + return true | |
113 | + } | |
114 | + }, | |
108 | 115 | waitFor: computed([ |
109 | 116 | following.sync, |
110 | 117 | subscribedChannels.sync |
111 | 118 | ], (...x) => x.every(Boolean)) |
Built with git-ssb-web