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 AMParent: 96abae57d9a36e5ff737d765423d6c092635fbd3
Files changed
views/public-feed.js | changed |
views/public-feed.js | ||
---|---|---|
@@ -168,15 +168,19 @@ | ||
168 | 168 … | if (c.type === 'contact') { |
169 | 169 … | updateContact(msg, follows) |
170 | 170 … | } else if (c.type === 'vote') { |
171 | 171 … | 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 … | + } | |
179 | 183 … | } |
180 | 184 … | } |
181 | 185 … | } else { |
182 | 186 … | if (c.root) { |
@@ -232,8 +236,9 @@ | ||
232 | 236 … | if (c.following) { |
233 | 237 … | if (!group) { |
234 | 238 … | group = groups[id] = { |
235 | 239 … | type: 'follow', |
240 … | + lastUpdateType: null, | |
236 | 241 … | contacts: new Set(), |
237 | 242 … | updated: 0, |
238 | 243 … | id: id |
239 | 244 … | } |
Built with git-ssb-web