Commit 7c4391f01e7cb30eb0441c981dddfc1678c0546b
don't freak out if some progress api is missing
Dominic Tarr committed on 5/20/2017, 11:11:36 PMParent: b3706f3f8cd9059bc82b3db294c8b4a4fdfe6424
Files changed
modules/feed/pull/private.js | changed |
modules/page/html/render/public.js | changed |
modules/progress/obs.js | changed |
modules/feed/pull/private.js | ||
---|---|---|
@@ -21,9 +21,9 @@ | ||
21 | 21 | delete opts.lt |
22 | 22 | } |
23 | 23 | |
24 | 24 | return StreamWhenConnected(api.sbot.obs.connection, (sbot) => { |
25 | - return (sbot.private.read || pull.empty)(opts) | |
25 | + return (sbot.private && sbot.private.read || pull.empty)(opts) | |
26 | 26 | }) |
27 | 27 | }) |
28 | 28 | } |
29 | 29 |
modules/page/html/render/public.js | ||
---|---|---|
@@ -200,9 +200,10 @@ | ||
200 | 200 | h('div.main', [ |
201 | 201 | h('div.name', [ api.about.obs.name(id) ]) |
202 | 202 | ]), |
203 | 203 | h('div.progress', [ |
204 | - api.progress.html.peer(id) | |
204 | +//PROGRESS. this is where replication progress is shown? | |
205 | +// api.progress.html.peer(id) | |
205 | 206 | ]) |
206 | 207 | ]) |
207 | 208 | }) |
208 | 209 | ]) |
modules/progress/obs.js | ||
---|---|---|
@@ -64,9 +64,15 @@ | ||
64 | 64 | }) |
65 | 65 | |
66 | 66 | watch(api.sbot.obs.connection, (sbot) => { |
67 | 67 | if (sbot) { |
68 | - var source = keyFn(sbot) | |
68 | + var source | |
69 | + try { | |
70 | + source = keyFn(sbot) | |
71 | + } catch (err) { | |
72 | + progress.set(err) | |
73 | + return progress | |
74 | + } | |
69 | 75 | if (source) { |
70 | 76 | pull( |
71 | 77 | source(), |
72 | 78 | pull.drain((event) => { |
@@ -79,4 +85,5 @@ | ||
79 | 85 | |
80 | 86 | return progress |
81 | 87 | } |
82 | 88 | } |
89 | + |
Built with git-ssb-web