git ssb

2+

mixmix / ticktack



Commit c70c742f67f3d60df3aedead6dbea7fbac4f4ae8

remove un-needed code

mix irving committed on 8/10/2017, 9:15:53 AM
Parent: 37dfcd8521f96075ab3aca87661e2198b0420d2b

Files changed

app/page/home.jschanged
app/page/home.jsView
@@ -2,33 +2,27 @@
22 const { h } = require('mutant')
33 const {threadReduce} = require('ssb-reduce-stream')
44 const pull = require('pull-stream')
55 const when = require('mutant/when')
6+const isObject = require('lodash/isObject')
7+const isString = require('lodash/isString')
68
79 exports.gives = nest('app.page.home')
810
911 exports.needs = nest({
12+ 'about.html.image': 'first',
13+ 'app.html.nav': 'first',
1014 'feed.pull.public': 'first',
11- 'app.html.nav': 'first',
1215 'history.sync.push': 'first',
1316 'message.sync.unbox': 'first',
14- 'about.html.image': 'first',
1517 })
1618
1719 function firstLine (text) {
1820 if(text.length < 80 && !~text.indexOf('\n')) return text
1921
2022 return text.split('\n')[0].substring(0, 80)
2123 }
2224
23-function isObject (o) {
24- return o && 'object' === typeof o
25-}
26-
27-function isString (s) {
28- return 'string' == typeof s
29-}
30-
3125 exports.create = (api) => {
3226 return nest('app.page.home', home)
3327
3428 function home (location) {
@@ -45,18 +39,15 @@
4539 }
4640
4741 function item (name, thread) {
4842 var reply = thread.replies && thread.replies[thread.replies.length-1]
49- if(!thread.value) {
43+ if(!thread.value) return
5044
51- }
52- if(!thread.value) return
5345 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+ ])
5950 }
6051
6152 function threadGroup (threads, obj, toName) {
6253 var div = h('div.group')
@@ -85,15 +76,13 @@
8576 container.appendChild(threadGroup(
8677 threads,
8778 threads.private,
8879 function (_, msg) {
89- console.log(msg)
90- if(!msg.value) debugger
91- return h('div.recps',
80+ return h('div.recps', [
9281 msg.value.content.recps.map(function (link) {
9382 return api.about.html.image(isString(link) ? link : link.link)
9483 })
95- )
84+ ])
9685 }
9786 ))
9887
9988 container.appendChild(threadGroup(

Built with git-ssb-web