git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit 1e97e10c01b52d7913be252f773d767c69120bcf

bring back peer sync progress

Matt McKegg committed on 6/10/2017, 12:37:08 AM
Parent: 78f161513725070b23d7b626a71e1ee9cea8a74d

Files changed

modules/page/html/render/public.jschanged
modules/progress/html/peer.jschanged
modules/page/html/render/public.jsView
@@ -202,10 +202,9 @@
202202 h('div.main', [
203203 h('div.name', [ api.about.obs.name(id) ])
204204 ]),
205205 h('div.progress', [
206-//PROGRESS. this is where replication progress is shown?
207-// api.progress.html.peer(id)
206+ api.progress.html.peer(id)
208207 ])
209208 ])
210209 })
211210 ])
modules/progress/html/peer.jsView
@@ -11,10 +11,20 @@
1111
1212 exports.create = function (api) {
1313 return nest('progress.html.peer', function (id) {
1414 var progress = api.progress.obs.peer(id)
15- var feeds = api.progress.obs.global().feeds
1615
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+
1727 var value = computed([progress, feeds], (pending, feeds) => {
1828 return (feeds - pending) / feeds
1929 })
2030

Built with git-ssb-web