corestore 7.4.3 → 7.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -241,6 +241,7 @@ class Corestore extends ReadyResource {
|
|
|
241
241
|
this.ns = opts.namespace || DEFAULT_NAMESPACE
|
|
242
242
|
this.manifestVersion = opts.manifestVersion || 1
|
|
243
243
|
this.shouldSuspend = isAndroid ? !!opts.suspend : opts.suspend !== false
|
|
244
|
+
this.active = opts.active !== false
|
|
244
245
|
|
|
245
246
|
this.watchers = null
|
|
246
247
|
this.watchIndex = -1
|
|
@@ -405,7 +406,7 @@ class Corestore extends ReadyResource {
|
|
|
405
406
|
muxer.cork()
|
|
406
407
|
|
|
407
408
|
for (const core of this.cores) {
|
|
408
|
-
if (!core.replicator.downloading || core.replicator.attached(muxer) || !core.opened) continue
|
|
409
|
+
if (!core.replicator.downloading || core.replicator.attached(muxer) || !core.opened || !this.active) continue
|
|
409
410
|
core.replicator.attachTo(muxer)
|
|
410
411
|
}
|
|
411
412
|
|
|
@@ -571,7 +572,7 @@ class Corestore extends ReadyResource {
|
|
|
571
572
|
}
|
|
572
573
|
|
|
573
574
|
core.replicator.ondownloading = () => {
|
|
574
|
-
this.streamTracker.attachAll(core)
|
|
575
|
+
if (this.active) this.streamTracker.attachAll(core)
|
|
575
576
|
}
|
|
576
577
|
|
|
577
578
|
this.cores.set(id, core)
|