git ssb

10+

Matt McKegg / patchwork



Commit 3dfc64e44061b79b9d06b8b067d711ed62c28896

tweaks to the way digs are rolled up, only show on original posts and only for current window

Matt McKegg committed on 10/28/2016, 5:30:35 AM
Parent: 96abae57d9a36e5ff737d765423d6c092635fbd3

Files changed

views/public-feed.jschanged
views/public-feed.jsView
@@ -168,15 +168,19 @@
168168 if (c.type === 'contact') {
169169 updateContact(msg, follows)
170170 } else if (c.type === 'vote') {
171171 if (c.vote && c.vote.link) {
172- const group = ensureMessage(c.root, messageUpdates)
173- if (c.vote.value > 1) {
174- group.lastUpdateType = 'dig'
175- group.digs.add(msg.value.author)
176- group.updated = msg.timestamp
177- } else {
178- group.digs.delete(msg.value.author)
172 + // only show digs of posts added in the current window
173 + // and only for the main post
174 + const group = messageUpdates[c.vote.link]
175 + if (group) {
176 + if (c.vote.value > 0) {
177 + group.lastUpdateType = 'dig'
178 + group.digs.add(msg.value.author)
179 + group.updated = msg.timestamp
180 + } else {
181 + group.digs.delete(msg.value.author)
182 + }
179183 }
180184 }
181185 } else {
182186 if (c.root) {
@@ -232,8 +236,9 @@
232236 if (c.following) {
233237 if (!group) {
234238 group = groups[id] = {
235239 type: 'follow',
240 + lastUpdateType: null,
236241 contacts: new Set(),
237242 updated: 0,
238243 id: id
239244 }

Built with git-ssb-web