corestore 7.12.0 → 7.12.1
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 +8 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -105,7 +105,7 @@ class CoreTracker {
|
|
|
105
105
|
store.watchIndex = -1
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
resume(id) {
|
|
108
|
+
resume(id, group) {
|
|
109
109
|
const core = this.map.get(id)
|
|
110
110
|
|
|
111
111
|
if (!core) return null
|
|
@@ -119,6 +119,8 @@ class CoreTracker {
|
|
|
119
119
|
core.gc = 0
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
if (group) resumeGroup(core, group).catch(noop)
|
|
123
|
+
|
|
122
124
|
return core
|
|
123
125
|
}
|
|
124
126
|
|
|
@@ -765,3 +767,8 @@ function noop() {}
|
|
|
765
767
|
function toHex(discoveryKey) {
|
|
766
768
|
return b4a.toString(discoveryKey, 'hex')
|
|
767
769
|
}
|
|
770
|
+
|
|
771
|
+
async function resumeGroup(core, group) {
|
|
772
|
+
await core.opening
|
|
773
|
+
if (!core.header.group) await core.setGroup(group)
|
|
774
|
+
}
|