Commit 6be75bf8038ec9c4d1cdba801434c1ef4db7c753
quick hack to add a block confirm dialog
TODO: probably should display more info about blockingMatt McKegg committed on 10/18/2017, 10:26:51 AM
Parent: 271cbdd2add56b26f6e997f982fb76db39f59d06
Files changed
plugs/contact/html/follow-toggle.js | changed |
plugs/contact/html/follow-toggle.js | ||
---|---|---|
@@ -4,8 +4,9 @@ | ||
4 | 4 | exports.gives = nest('contact.html.followToggle') |
5 | 5 | exports.needs = nest({ |
6 | 6 | 'intl.sync.i18n': 'first', |
7 | 7 | 'keys.sync.id': 'first', |
8 | + 'message.async.publish': 'first', | |
8 | 9 | 'contact.async.follow': 'first', |
9 | 10 | 'contact.async.unfollow': 'first', |
10 | 11 | 'contact.async.block': 'first', |
11 | 12 | 'contact.async.unblock': 'first', |
@@ -71,12 +72,21 @@ | ||
71 | 72 | ), |
72 | 73 | when(showBlockButton, h('a.ToggleButton.-blocking', { |
73 | 74 | 'href': '#', |
74 | 75 | '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) | |
76 | 77 | }, i18n('Block'))) |
77 | 78 | ]) |
78 | 79 | } else { |
79 | 80 | return [] |
80 | 81 | } |
81 | 82 | }) |
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 | + } | |
82 | 92 | } |
Built with git-ssb-web