git ssb

10+

Matt McKegg / patchwork



Commit 6be75bf8038ec9c4d1cdba801434c1ef4db7c753

quick hack to add a block confirm dialog

TODO: probably should display more info about blocking
Matt McKegg committed on 10/18/2017, 10:26:51 AM
Parent: 271cbdd2add56b26f6e997f982fb76db39f59d06

Files changed

plugs/contact/html/follow-toggle.jschanged
plugs/contact/html/follow-toggle.jsView
@@ -4,8 +4,9 @@
44 exports.gives = nest('contact.html.followToggle')
55 exports.needs = nest({
66 'intl.sync.i18n': 'first',
77 'keys.sync.id': 'first',
8+ 'message.async.publish': 'first',
89 'contact.async.follow': 'first',
910 'contact.async.unfollow': 'first',
1011 'contact.async.block': 'first',
1112 'contact.async.unblock': 'first',
@@ -71,12 +72,21 @@
7172 ),
7273 when(showBlockButton, h('a.ToggleButton.-blocking', {
7374 'href': '#',
7475 'title': i18n('Click to block syncing with this person and hide their posts'),
75- 'ev-click': send(api.contact.async.block, id)
76+ 'ev-click': send(block, id)
7677 }, i18n('Block')))
7778 ])
7879 } else {
7980 return []
8081 }
8182 })
83+
84+ function block (id) {
85+ // displays message confirm
86+ api.message.async.publish({
87+ type: 'contact',
88+ contact: id,
89+ blocking: true
90+ })
91+ }
8292 }

Built with git-ssb-web