git ssb

7+

dinoworm 🐛 / patchcore



Commit 5bf9003bf30896588e270828be3849bad367dc57

thread: include branch replies

Matt McKegg committed on 6/30/2017, 1:46:31 AM
Parent: 6968c0124e986e553c39047ae4d272d231bcd6b7

Files changed

feed/obs/thread.jschanged
feed/obs/thread.jsView
@@ -31,9 +31,12 @@
3131
3232 var backlinks = api.backlinks.obs.for(rootId)
3333 var replies = map(computed(backlinks, (msgs) => {
3434 return msgs.filter(msg => {
35- return api.message.sync.root(msg) === rootId && msg.value.content.type !== 'vote'
35 + return msg.value.content.type !== 'vote' && (
36 + api.message.sync.root(msg) === rootId ||
37 + matchAny(msg.value.content.branch, rootId)
38 + )
3639 })
3740 }), x => Value(x), {
3841 // avoid refresh of entire list when items added
3942 comparer: (a, b) => a === b
@@ -92,12 +95,8 @@
9295 }
9396 }
9497 }
9598
96-function getKey (msg) {
97- return msg.key
98-}
99-
10099 function PreviousKey (collection, item) {
101100 return computed(collection, (c) => {
102101 var index = collection.indexOf(item)
103102 if (~index) {
@@ -107,4 +106,12 @@
107106 }
108107 }
109108 })
110109 }
110 +
111 +function matchAny (valueOrArray, compare) {
112 + if (valueOrArray === compare) {
113 + return true
114 + } else if (Array.isArray(valueOrArray)) {
115 + return valueOrArray.includes(compare)
116 + }
117 +}

Built with git-ssb-web