Commit 1e37adb6639b35ce588fd25a2924a389b272b1f1
clean up some code in blog (standard js)
Matt McKegg committed on 4/13/2018, 4:10:30 AMParent: b13a4ef7ad49f0ccd4f289b5941f55999a4f0ffc
Files changed
plugs/message/html/render/blog.js | changed |
plugs/message/html/render/blog.js | ||
---|---|---|
@@ -1,9 +1,8 @@ | ||
1 | 1 | const nest = require('depnest') |
2 | 2 | const isBlog = require('scuttle-blog/isBlog') |
3 | -const { h, Value, computed, when, resolve } = require('mutant') | |
3 | +const { h, when, resolve } = require('mutant') | |
4 | 4 | |
5 | - | |
6 | 5 | exports.gives = nest('message.html', { |
7 | 6 | canRender: true, |
8 | 7 | render: true |
9 | 8 | }) |
@@ -18,16 +17,13 @@ | ||
18 | 17 | 'sbot.obs.connection': 'first' |
19 | 18 | }) |
20 | 19 | |
21 | 20 | exports.create = function (api) { |
22 | - | |
23 | 21 | return nest('message.html', { |
24 | 22 | render: blogRenderer, |
25 | 23 | canRender |
26 | 24 | }) |
27 | 25 | |
28 | - return nest('message.html.render', blogRenderer) | |
29 | - | |
30 | 26 | function blogRenderer (msg, opts) { |
31 | 27 | if (!canRender(msg)) return |
32 | 28 | |
33 | 29 | var content = null |
@@ -45,9 +41,9 @@ | ||
45 | 41 | color: api.about.obs.color, |
46 | 42 | blobUrl: api.blob.sync.url |
47 | 43 | }) |
48 | 44 | } |
49 | - | |
45 | + | |
50 | 46 | const element = api.message.html.layout(msg, Object.assign({}, { |
51 | 47 | content, |
52 | 48 | layout: 'default' |
53 | 49 | }, opts)) |
@@ -93,5 +89,5 @@ | ||
93 | 89 | } |
94 | 90 | |
95 | 91 | function canRender (msg) { |
96 | 92 | if (isBlog(msg)) return true |
97 | -} | |
93 | +} |
Built with git-ssb-web