Commit 91f1dbf0c7c54a8643ec944ee3e39bc4f108d606
only show followers/followees if they are "true"
Ev Bogue committed on 6/16/2018, 3:58:32 AMParent: 75c3c2588ae4ea1eadb0ee1f53043712acd72941
Files changed
tools.js | changed |
tools.js | ||
---|---|---|
@@ -22,12 +22,14 @@ | ||
22 | 22 … | following.appendChild(h('br')) |
23 | 23 … | |
24 | 24 … | sbot.friends.get({source: src}, function (err, follows) { |
25 | 25 … | for (var i in follows) { |
26 | - //this needs to iterative over each object within follows and only print if TRUE | |
27 | - following.appendChild(h('a', {title: avatar.name(i).textContent, href: '#' + i}, h('span.avatar--small', avatar.image(i)))) | |
28 | - count++ | |
29 | - following.firstChild.textContent = 'Following: ' + count | |
26 … | + if (follows.hasOwnProperty(i)) { | |
27 … | + if (follows[i] == true) | |
28 … | + following.appendChild(h('a', {title: avatar.name(i).textContent, href: '#' + i}, h('span.avatar--small', avatar.image(i)))) | |
29 … | + count++ | |
30 … | + following.firstChild.textContent = 'Following: ' + count | |
31 … | + } | |
30 | 32 … | } |
31 | 33 … | }) |
32 | 34 … | |
33 | 35 … | return following |
@@ -43,11 +45,15 @@ | ||
43 | 45 … | followers.appendChild(h('br')) |
44 | 46 … | |
45 | 47 … | sbot.friends.get({dest: src}, function (err, follows) { |
46 | 48 … | for (var i in follows) { |
47 | - followers.appendChild(h('a', {title: avatar.name(i).textContent, href: '#' + i}, h('span.avatar--small', avatar.image(i)))) | |
48 | - count++ | |
49 | - followers.firstChild.textContent = 'Followers: ' + count | |
49 … | + if (follows.hasOwnProperty(i)) { | |
50 … | + if (follows[i] == true) { | |
51 … | + followers.appendChild(h('a', {title: avatar.name(i).textContent, href: '#' + i}, h('span.avatar--small', avatar.image(i)))) | |
52 … | + count++ | |
53 … | + followers.firstChild.textContent = 'Followers: ' + count | |
54 … | + } | |
55 … | + } | |
50 | 56 … | } |
51 | 57 … | }) |
52 | 58 … | |
53 | 59 … |
Built with git-ssb-web