Commit 20ecb42e14437431422a5f7f0615b0f7f878cb64
don't your own messages as unread
Dominic Tarr committed on 11/19/2017, 9:14:50 PMParent: 7e24f761d4772ef1ac78ab33da6743bb7e1d821d
Files changed
app/html/context.js | changed |
app/html/context.js | ||
---|---|---|
@@ -38,11 +38,13 @@ | ||
38 | 38 | pull.filter(msg => msg.value.content.type === 'post'), // TODO is this the best way to protect against votes? |
39 | 39 | pull.filter(msg => msg.value.content.recps), |
40 | 40 | pull.drain(msg => { |
41 | 41 | var author = msg.value.author |
42 | - if(api.unread.sync.isUnread(msg)) | |
42 | + if(api.unread.sync.isUnread(msg)) { | |
43 | + var seen = author === myKey ? 0 : 1 | |
43 | 44 | recentPeersContacted |
44 | - .put(author, (recentPeersContacted.get(author)||0)+1) | |
45 | + .put(author, (recentPeersContacted.get(author)||0)+seen) | |
46 | + } | |
45 | 47 | else |
46 | 48 | recentPeersContacted.put(author, 0) |
47 | 49 | }) |
48 | 50 | ) |
@@ -52,8 +54,9 @@ | ||
52 | 54 | LevelTwoContext() |
53 | 55 | ]) |
54 | 56 | |
55 | 57 | function LevelOneContext () { |
58 | + //the "discovery" button | |
56 | 59 | const PAGES_UNDER_DISCOVER = ['blogIndex', 'blogShow', 'home'] |
57 | 60 | |
58 | 61 | return h('div.level.-one', [ |
59 | 62 | // Nearby |
@@ -88,9 +91,9 @@ | ||
88 | 91 | const lastMsg = value() |
89 | 92 | if (nearby.has(feedId)) return |
90 | 93 | |
91 | 94 | return Option({ |
92 | - //XXX not a random number of notifications. | |
95 | + //the number of threads with each peer | |
93 | 96 | notifications: value, |
94 | 97 | //Math.random() > 0.7 ? Math.floor(Math.random()*9+1) : 0, // TODO |
95 | 98 | imageEl: api.about.html.avatar(feedId), |
96 | 99 | label: api.about.obs.name(feedId), |
@@ -159,4 +162,6 @@ | ||
159 | 162 | } |
160 | 163 | }) |
161 | 164 | } |
162 | 165 | |
166 | + | |
167 | + |
Built with git-ssb-web