git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit 7fcedd68ba11b29b833cf44059c4ed648f429b28

display pending updates on public tab

Matt McKegg committed on 2/15/2017, 2:38:55 PM
Parent: 9b14c2770a1b327ee389c1c27a56ae36412130c0

Files changed

modules/page/html/render/public.jschanged
modules/page/html/render/public.jsView
@@ -61,50 +61,50 @@
6161 }
6262 }
6363 })
6464
65- return h('div.SplitView', [
65+ var feedView = api.feed.html.rollup(getFeed, {
66+ waitUntil: computed([
67+ following.sync,
68+ subscribedChannels.sync
69+ ], (...x) => x.every(Boolean)),
70+ windowSize: 500,
71+ filter: (item) => {
72+ return !item.boxed && (
73+ id === item.author ||
74+ following().has(item.author) ||
75+ subscribedChannels().has(item.channel) ||
76+ (item.repliesFrom && item.repliesFrom.has(id)) ||
77+ item.digs && item.digs.has(id)
78+ )
79+ },
80+ bumpFilter: (msg, group) => {
81+ if (!group.message) {
82+ return (
83+ isMentioned(id, msg.value.content.mentions) ||
84+ msg.value.author === id || (
85+ fromDay(msg, group.fromTime) && (
86+ following().has(msg.value.author) ||
87+ group.repliesFrom.has(id)
88+ )
89+ )
90+ )
91+ }
92+ return true
93+ }
94+ })
95+
96+ var result = h('div.SplitView', [
6697 h('div.side', [
6798 getSidebar()
6899 ]),
69- h('div.main', [
70- getFeedView()
71- ])
100+ h('div.main', feedView)
72101 ])
73102
74- function getFeedView () {
75- return api.feed.html.rollup(getFeed, {
76- waitUntil: computed([
77- following.sync,
78- subscribedChannels.sync
79- ], (...x) => x.every(Boolean)),
80- windowSize: 500,
81- filter: (item) => {
82- return !item.boxed && (
83- id === item.author ||
84- following().has(item.author) ||
85- subscribedChannels().has(item.channel) ||
86- (item.repliesFrom && item.repliesFrom.has(id)) ||
87- item.digs && item.digs.has(id)
88- )
89- },
90- bumpFilter: (msg, group) => {
91- if (!group.message) {
92- return (
93- isMentioned(id, msg.value.content.mentions) ||
94- msg.value.author === id || (
95- fromDay(msg, group.fromTime) && (
96- following().has(msg.value.author) ||
97- group.repliesFrom.has(id)
98- )
99- )
100- )
101- }
102- return true
103- }
104- })
105- }
103+ result.pendingUpdates = feedView.pendingUpdates
106104
105+ return result
106+
107107 function getSidebar () {
108108 var whoToFollow = computed([following, api.profile.obs.recentlyUpdated(200)], (following, recent) => {
109109 return Array.from(recent).filter(x => x !== id && !following.has(x)).slice(0, 10)
110110 })

Built with git-ssb-web