git ssb

2+

ev / mvd



Commit 554227b56bc038b7b417b65385e48ab32fd189cf

don't search for votes if there is no message key

Ev Bogue committed on 5/1/2018, 2:37:27 AM
Parent: 12a75517dfb361b5f8a4df0c91372c0c68f1f164

Files changed

tools.jschanged
tools.jsView
@@ -10,19 +10,20 @@
1010 var config = require('./config')()
1111
1212 function votes (msg) {
1313 var votes = h('div.votes')
14-
15- pull(
16- sbot.backlinks({query: [{$filter: {dest: msg.key, value: { content: { type: 'vote' }}}}], live: true}),
17- pull.drain(function (data) {
18- console.log(data)
19- if (data.value) {
20- votes.appendChild(h('a', {href:'#' + data.key}, h('img.emoji', {src: config.emojiUrl + 'star.png'})))
14 + if (msg.key) {
15 + pull(
16 + sbot.backlinks({query: [{$filter: {dest: msg.key, value: { content: { type: 'vote' }}}}], live: true}),
17 + pull.drain(function (data) {
2118 console.log(data)
22- } else {console.log(data)}
23- })
24- )
19 + if (data.value) {
20 + votes.appendChild(h('a', {href:'#' + data.key}, h('img.emoji', {src: config.emojiUrl + 'star.png'})))
21 + console.log(data)
22 + } else {console.log(data)}
23 + })
24 + )
25 + }
2526 return votes
2627 }
2728
2829 module.exports.header = function (msg) {

Built with git-ssb-web