git ssb

16+

Dominic / patchbay



Commit d7221d981ca25931b54c37c514c78e9803027278

fix new follow loading button

mix irving committed on 1/28/2017, 2:30:45 AM
Parent: 78d39dc669df20b2f705b64f5de61c54906da3d2

Files changed

modules_basic/follow.jschanged
modules_basic/follow.jsView
@@ -59,13 +59,13 @@
5959 var follows_you, you_follow
6060
6161 var self_id = require('../keys').id
6262 api.follower_of(self_id, id, (err, f) => {
63- you_follow = f
63 + you_follow = f || false
6464 update()
6565 })
6666 api.follower_of(id, self_id, (err, f) => {
67- follows_you = f
67 + follows_you = f || false
6868 update()
6969 })
7070
7171 var followBtn = h('button', { 'ev-click': toggleFollow }, 'loading')
@@ -78,8 +78,9 @@
7878 : you_follow ? '- you are following'
7979 : ''
8080 )
8181
82 + // wait till finished loading before offering follow options
8283 if (you_follow === undefined) return
8384 followBtn.textContent = you_follow ? 'unfollow' : 'follow'
8485 }
8586
@@ -98,9 +99,9 @@
9899
99100 api.message_confirm(msg, (err, msg) => {
100101 if (err) return console.error(err)
101102
102- you_follow = msg.value.content.following
103 + you_follow = !you_follow
103104 update()
104105 })
105106 }
106107

Built with git-ssb-web