@kedataindo/docflow-core 0.0.36 → 0.0.38

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/dist/index.cjs CHANGED
@@ -214,7 +214,19 @@ function createCollaboration(options) {
214
214
  const ws = provider;
215
215
  readyParts.push(
216
216
  new Promise((resolve) => {
217
- ws.once("sync", () => resolve());
217
+ let settled = false;
218
+ const done = () => {
219
+ if (settled) return;
220
+ settled = true;
221
+ resolve();
222
+ };
223
+ if (ws.synced) {
224
+ done();
225
+ return;
226
+ }
227
+ ws.once("sync", done);
228
+ ws.once("synced", done);
229
+ setTimeout(done, 5e3);
218
230
  })
219
231
  );
220
232
  }
package/dist/index.js CHANGED
@@ -156,7 +156,19 @@ function createCollaboration(options) {
156
156
  const ws = provider;
157
157
  readyParts.push(
158
158
  new Promise((resolve) => {
159
- ws.once("sync", () => resolve());
159
+ let settled = false;
160
+ const done = () => {
161
+ if (settled) return;
162
+ settled = true;
163
+ resolve();
164
+ };
165
+ if (ws.synced) {
166
+ done();
167
+ return;
168
+ }
169
+ ws.once("sync", done);
170
+ ws.once("synced", done);
171
+ setTimeout(done, 5e3);
160
172
  })
161
173
  );
162
174
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kedataindo/docflow-core",
3
3
  "license": "UNLICENSED",
4
- "version": "0.0.36",
4
+ "version": "0.0.38",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",