Commit 2d319604d082cb2300af0e54c6416b00bdeb9884
filter threads for repeats
Dominic Tarr committed on 8/24/2017, 1:53:22 AMParent: 9b05eee01a12392729755fabfccef269c4748684
Files changed
app/page/home.js | changed |
app/page/home.js | ||
---|---|---|
@@ -82,17 +82,21 @@ | ||
82 | 82 | m = Math.max(thread.replies[i].timestamp||0, m) |
83 | 83 | return m |
84 | 84 | } |
85 | 85 | |
86 | + var o = {} | |
86 | 87 | function roots (r) { |
87 | - return Object.keys(r || {}).map(function (k) { | |
88 | - return threads.roots[r[k]] | |
88 | + return Object.keys(r || {}).map(function (name) { | |
89 | + var id = r[name] | |
90 | + if(!o[id]) { | |
91 | + o[id] = true | |
92 | + return threads.roots[id] | |
93 | + } | |
89 | 94 | }).filter(function (e) { |
90 | 95 | return e && e.value |
91 | 96 | }) |
92 | 97 | } |
93 | 98 | |
94 | - | |
95 | 99 | var groupedThreads = roots(threads.private) |
96 | 100 | .concat(roots(threads.channels)) |
97 | 101 | .concat(roots(threads.groups)) |
98 | 102 | .filter(function (thread) { |
@@ -133,4 +137,15 @@ | ||
133 | 137 | ]) |
134 | 138 | }) |
135 | 139 | } |
136 | 140 | |
141 | + | |
142 | + | |
143 | + | |
144 | + | |
145 | + | |
146 | + | |
147 | + | |
148 | + | |
149 | + | |
150 | + | |
151 | + |
Built with git-ssb-web