message/html/likes.jsView |
---|
9 | 9 | |
10 | 10 | exports.gives = nest('message.html.likes') |
11 | 11 | |
12 | 12 | exports.create = (api) => { |
13 | | - return nest('message.html.likes', function likes (msg) { |
| 13 | + return nest('message.html.likes', function likes(msg) { |
14 | 14 | var id = api.keys.sync.id() |
15 | 15 | var likes = api.message.obs.likes(msg.key) |
16 | 16 | |
17 | 17 | var iLike = computed(likes, likes => likes.includes(id)) |
22 | 22 | h('div.count', count) |
23 | 23 | ]) |
24 | 24 | }) |
25 | 25 | |
26 | | - function publishLike (msg, status = true) { |
| 26 | + function publishLike(msg, status = true) { |
27 | 27 | var like = status ? { |
28 | 28 | type: 'vote', |
29 | 29 | channel: msg.value.content.channel, |
30 | 30 | vote: { link: msg.key, value: 1, expression: 'Like' } |
31 | 31 | } : { |
32 | | - type: 'vote', |
33 | | - channel: msg.value.content.channel, |
34 | | - vote: { link: msg.key, value: 0, expression: 'Unlike' } |
35 | | - } |
| 32 | + type: 'vote', |
| 33 | + channel: msg.value.content.channel, |
| 34 | + vote: { link: msg.key, value: 0, expression: 'Unlike' } |
| 35 | + } |
36 | 36 | if (msg.value.content.recps) { |
37 | 37 | like.recps = msg.value.content.recps.map(function (e) { |
38 | 38 | return e && typeof e !== 'string' ? e.link : e |
39 | 39 | }) |