Commit c70c742f67f3d60df3aedead6dbea7fbac4f4ae8
remove un-needed code
mix irving committed on 8/10/2017, 9:15:53 AMParent: 37dfcd8521f96075ab3aca87661e2198b0420d2b
Files changed
app/page/home.js | changed |
app/page/home.js | ||
---|---|---|
@@ -2,33 +2,27 @@ | ||
2 | 2 | const { h } = require('mutant') |
3 | 3 | const {threadReduce} = require('ssb-reduce-stream') |
4 | 4 | const pull = require('pull-stream') |
5 | 5 | const when = require('mutant/when') |
6 | +const isObject = require('lodash/isObject') | |
7 | +const isString = require('lodash/isString') | |
6 | 8 | |
7 | 9 | exports.gives = nest('app.page.home') |
8 | 10 | |
9 | 11 | exports.needs = nest({ |
12 | + 'about.html.image': 'first', | |
13 | + 'app.html.nav': 'first', | |
10 | 14 | 'feed.pull.public': 'first', |
11 | - 'app.html.nav': 'first', | |
12 | 15 | 'history.sync.push': 'first', |
13 | 16 | 'message.sync.unbox': 'first', |
14 | - 'about.html.image': 'first', | |
15 | 17 | }) |
16 | 18 | |
17 | 19 | function firstLine (text) { |
18 | 20 | if(text.length < 80 && !~text.indexOf('\n')) return text |
19 | 21 | |
20 | 22 | return text.split('\n')[0].substring(0, 80) |
21 | 23 | } |
22 | 24 | |
23 | -function isObject (o) { | |
24 | - return o && 'object' === typeof o | |
25 | -} | |
26 | - | |
27 | -function isString (s) { | |
28 | - return 'string' == typeof s | |
29 | -} | |
30 | - | |
31 | 25 | exports.create = (api) => { |
32 | 26 | return nest('app.page.home', home) |
33 | 27 | |
34 | 28 | function home (location) { |
@@ -45,18 +39,15 @@ | ||
45 | 39 | } |
46 | 40 | |
47 | 41 | function item (name, thread) { |
48 | 42 | var reply = thread.replies && thread.replies[thread.replies.length-1] |
49 | - if(!thread.value) { | |
43 | + if(!thread.value) return | |
50 | 44 | |
51 | - } | |
52 | - if(!thread.value) return | |
53 | 45 | return h('div.threadLink', link(thread), [ |
54 | - name, | |
55 | - h('div.subject', [subject(thread.value)]), | |
56 | - reply ? h('div.reply', [subject(reply.value)]) : null | |
57 | - ] | |
58 | - ) | |
46 | + name, | |
47 | + h('div.subject', [subject(thread.value)]), | |
48 | + reply ? h('div.reply', [subject(reply.value)]) : null | |
49 | + ]) | |
59 | 50 | } |
60 | 51 | |
61 | 52 | function threadGroup (threads, obj, toName) { |
62 | 53 | var div = h('div.group') |
@@ -85,15 +76,13 @@ | ||
85 | 76 | container.appendChild(threadGroup( |
86 | 77 | threads, |
87 | 78 | threads.private, |
88 | 79 | function (_, msg) { |
89 | - console.log(msg) | |
90 | - if(!msg.value) debugger | |
91 | - return h('div.recps', | |
80 | + return h('div.recps', [ | |
92 | 81 | msg.value.content.recps.map(function (link) { |
93 | 82 | return api.about.html.image(isString(link) ? link : link.link) |
94 | 83 | }) |
95 | - ) | |
84 | + ]) | |
96 | 85 | } |
97 | 86 | )) |
98 | 87 | |
99 | 88 | container.appendChild(threadGroup( |
Built with git-ssb-web