aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/transfers.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/transfers.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/transfers.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/transfers.js b/packages/meshbay-hub/src/meshbay_hub/static/transfers.js
index 797321c..524b7f3 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/transfers.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/transfers.js
@@ -141,7 +141,7 @@ export class TransferStore {
* there is somewhere to write — see file-utils.js's downloadEntry.
*/
start({ kind, name, total = 0, transport = null, run, open = null,
- lease = null, prepare = null, makeLease = null }) {
+ lease = null, prepare = null, makeLease = null, pausable = false }) {
const item = {
id: _nextId++,
kind, name, total, transport, open, lease,
@@ -156,8 +156,11 @@ export class TransferStore {
error: '',
samples: [{ t: this._now(), done: 0 }],
signal: { aborted: false, paused: false },
- // Set from `prepare`: whether this target can be stopped and continued.
- pausable: false,
+ // Whether this transfer can be stopped and continued. A download learns
+ // it from `prepare`, because only its target knows; an upload says so
+ // outright, because a `File` is always seekable and the node keeps the
+ // position (see uploads.py).
+ pausable: Boolean(pausable),
// Where a resumed run picks up, in chunks. Zero until something pauses.
resumeFrom: 0,
// Resolved by resume(); awaited by the run loop while paused.