Commit 45c195c84b03f8b59506412b83fb5ffb84a81de1
Fix issue state calculation to use new schema
cel committed on 11/2/2016, 1:24:21 AMParent: e57e0b2e0fe80c4c2e214c956350d821f909dbd5
Files changed
issues.js | changed |
issues.js | ||
---|---|---|
@@ -50,26 +50,14 @@ | ||
50 | 50 … | if(ary[i].key === key) return ary[i] |
51 | 51 … | } |
52 | 52 … | |
53 | 53 … | 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 } | |
72 | 60 … | }, function () { |
73 | 61 … | console.log('drain', ary) |
74 | 62 … | pull( |
75 | 63 … | pull.values(ary), |
Built with git-ssb-web