Commit 209cf6da3ac17a31133e9d4378d50f892a560a35
fix message publish confirm with latest patchcore type checking
Matt McKegg committed on 3/17/2017, 5:43:02 AMParent: 36d9a3012c107f9588bb30bdbcee9284d08ee437
Files changed
plugs/message/html/layout/default.js | changed |
plugs/message/html/meta/likes.js | changed |
plugs/message/html/layout/default.js | ||
---|---|---|
@@ -1,6 +1,7 @@ | ||
1 | -const { when, h, map } = require('mutant') | |
1 | +const { when, h, map, computed } = require('mutant') | |
2 | 2 | var nest = require('depnest') |
3 | +var ref = require('ssb-ref') | |
3 | 4 | |
4 | 5 | exports.needs = nest({ |
5 | 6 | 'profile.html.person': 'first', |
6 | 7 | 'message.obs.backlinks': 'first', |
@@ -50,13 +51,17 @@ | ||
50 | 51 | }, [ |
51 | 52 | h('strong', 'Referenced from'), ' ', api.message.obs.name(backlink) |
52 | 53 | ]) |
53 | 54 | }), |
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 | + }) | |
59 | 64 | ]) |
60 | 65 | |
61 | 66 | // scoped |
62 | 67 |
plugs/message/html/meta/likes.js | ||
---|---|---|
@@ -7,9 +7,11 @@ | ||
7 | 7 | }) |
8 | 8 | |
9 | 9 | exports.create = function (api) { |
10 | 10 | 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 | + } | |
12 | 14 | }) |
13 | 15 | |
14 | 16 | function likeCount (likes) { |
15 | 17 | if (likes.length) { |
Built with git-ssb-web