git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit 0fea233fca9208a686f53687dc39b14b3215c371

fix following since follow toggle button

Matt McKegg committed on 10/17/2017, 1:06:47 AM
Parent: f51b630f45cbadef6273df197f1bbeecd968edb0

Files changed

plugs/contact/html/follow-toggle.jschanged
plugs/contact/html/follow-toggle.jsView
@@ -4,8 +4,10 @@
44 exports.gives = nest('contact.html.followToggle')
55 exports.needs = nest({
66 'intl.sync.i18n': 'first',
77 'keys.sync.id': 'first',
8+ 'contact.async.follow': 'first',
9+ 'contact.async.unfollow': 'first',
810 'contact.async.block': 'first',
911 'contact.async.unblock': 'first',
1012 'contact.obs.following': 'first',
1113 'contact.obs.followers': 'first',
@@ -59,13 +61,13 @@
5961 when(youFollow,
6062 h('a.ToggleButton.-unsubscribe', {
6163 'href': '#',
6264 'title': i18n('Click to unfollow'),
63- 'ev-click': send(unfollow, id)
65+ 'ev-click': send(api.contact.async.unfollow, id)
6466 }, when(isFriends, i18n('Friends'), i18n('Following'))),
6567 h('a.ToggleButton.-subscribe', {
6668 'href': '#',
67- 'ev-click': send(follow, id)
69+ 'ev-click': send(api.contact.async.follow, id)
6870 }, when(followsYou, i18n('Follow Back'), i18n('Follow')))
6971 ),
7072 when(showBlockButton, h('a.ToggleButton.-blocking', {
7173 'href': '#',
@@ -76,21 +78,5 @@
7678 } else {
7779 return []
7880 }
7981 })
80-
81- function follow (id) {
82- api.sbot.async.publish({
83- type: 'contact',
84- contact: id,
85- following: true
86- })
87- }
88-
89- function unfollow (id) {
90- api.sbot.async.publish({
91- type: 'contact',
92- contact: id,
93- following: false
94- })
95- }
9682 }

Built with git-ssb-web