git ssb

10+

Matt McKegg / patchwork



Commit 0ae3757980ed868524769abdc7b07da937191e78

fix peer connected state and progress, use gossip.changes

Matt McKegg committed on 6/30/2017, 10:24:58 AM
Parent: ae7ae9dc9178bc5dabc8ffa99f0d0caad2c5f8e5

Files changed

modules/page/html/render/public.jschanged
modules/progress/html/peer.jschanged
package.jsonchanged
modules/page/html/render/public.jsView
@@ -156,10 +156,13 @@
156156 h('div', {
157157 classList: 'ProfileList'
158158 }, [
159159 map(ids, (id) => {
160+ var connected = computed([connectedPeers, id], (peers, id) => peers.includes(id))
160161 return h('a.profile', {
161- classList: [ '-connected' ],
162+ classList: [
163+ when(connected, '-connected')
164+ ],
162165 href: id
163166 }, [
164167 h('div.avatar', [api.about.html.image(id)]),
165168 h('div.main', [
modules/progress/html/peer.jsView
@@ -5,26 +5,15 @@
55
66 exports.needs = nest({
77 'progress.html.render': 'first',
88 'progress.obs.peer': 'first',
9- 'progress.obs.global': 'first'
9+ 'progress.obs.replicate': 'first'
1010 })
1111
1212 exports.create = function (api) {
1313 return nest('progress.html.peer', function (id) {
1414 var progress = api.progress.obs.peer(id)
15-
16- var max = 0
17- var feeds = computed([api.progress.obs.global().feeds, progress], function (feeds, progress) {
18- // handle when feeds hasn't finished loading yet, take max from progress
19- if (progress) {
20- max = Math.max(max, feeds || 0, progress)
21- } else {
22- max = feeds
23- }
24- return max
25- })
26-
15+ var feeds = api.progress.obs.replicate().feeds
2716 var value = computed([progress, feeds], (pending, feeds) => {
2817 return (feeds - pending) / feeds
2918 })
3019
package.jsonView
@@ -35,9 +35,9 @@
3535 "mutant": "^3.21.2",
3636 "mutant-pull-reduce": "^1.1.0",
3737 "obv": "0.0.1",
3838 "packet-stream": "github:ssbc/packet-stream#c358f319390f9deaf2a015ae276fbdcc965cb4a8",
39- "patchcore": "~1.7.2",
39+ "patchcore": "~1.8.0",
4040 "pull-abortable": "^4.1.0",
4141 "pull-defer": "^0.2.2",
4242 "pull-file": "~1.0.0",
4343 "pull-identify-filetype": "^1.1.0",

Built with git-ssb-web