git ssb

2+

Dominic / issue-queue



Commit 45c195c84b03f8b59506412b83fb5ffb84a81de1

Fix issue state calculation to use new schema

cel committed on 11/2/2016, 1:24:21 AM
Parent: e57e0b2e0fe80c4c2e214c956350d821f909dbd5

Files changed

issues.jschanged
issues.jsView
@@ -50,26 +50,14 @@
5050 if(ary[i].key === key) return ary[i]
5151 }
5252
5353 pull(
54- sbot.query.read({query: [
55- {$filter: {
56- value: {content: {type: 'issue-edit'}}
57- }}
58- ]}),
59- pull.drain(function (issue) {
60- var parent, open
61- if(issue.value.content.issue) {
62- parent = issue.value.content.issue
63- open = issue.value.content.open
64- }
65- else {
66- parent = issue.value.content.issues[0].link
67- open = issue.value.content.issues[0].open
68- }
69-
70- var op = find(parent)
71- if(op) { op.open = open; op.edited = parent }
54 + sbot.links({rel: 'issues', values: true}),
55 + pull.map(function (msg) { return msg.value.content.issues }),
56 + pull.flatten(),
57 + pull.drain(function (op) {
58 + var issue = find(op.link)
59 + if(issue) { issue.open = op.open; op.edited = op.link }
7260 }, function () {
7361 console.log('drain', ary)
7462 pull(
7563 pull.values(ary),

Built with git-ssb-web