git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit 209cf6da3ac17a31133e9d4378d50f892a560a35

fix message publish confirm with latest patchcore type checking

Matt McKegg committed on 3/17/2017, 5:43:02 AM
Parent: 36d9a3012c107f9588bb30bdbcee9284d08ee437

Files changed

plugs/message/html/layout/default.jschanged
plugs/message/html/meta/likes.jschanged
plugs/message/html/layout/default.jsView
@@ -1,6 +1,7 @@
1-const { when, h, map } = require('mutant')
1+const { when, h, map, computed } = require('mutant')
22 var nest = require('depnest')
3+var ref = require('ssb-ref')
34
45 exports.needs = nest({
56 'profile.html.person': 'first',
67 'message.obs.backlinks': 'first',
@@ -50,13 +51,17 @@
5051 }, [
5152 h('strong', 'Referenced from'), ' ', api.message.obs.name(backlink)
5253 ])
5354 }),
54- when(msg.key, h('footer', [
55- h('div.actions', [
56- api.message.html.action(msg)
57- ])
58- ]))
55+ computed(msg.key, (key) => {
56+ if (ref.isMsg(key)) {
57+ return h('footer', [
58+ h('div.actions', [
59+ api.message.html.action(msg)
60+ ])
61+ ])
62+ }
63+ })
5964 ])
6065
6166 // scoped
6267
plugs/message/html/meta/likes.jsView
@@ -7,9 +7,11 @@
77 })
88
99 exports.create = function (api) {
1010 return nest('message.html.meta', function likes (msg) {
11- return computed(api.message.obs.likes(msg.key), likeCount)
11+ if (msg.key) {
12+ return computed(api.message.obs.likes(msg.key), likeCount)
13+ }
1214 })
1315
1416 function likeCount (likes) {
1517 if (likes.length) {

Built with git-ssb-web