@ones-editor/editor 1.1.3-bate.1 → 1.1.3-bate.2

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.js CHANGED
@@ -34019,6 +34019,11 @@ ${codeText}
34019
34019
  this.url = url;
34020
34020
  this.reauthFunc = reauthFunc;
34021
34021
  this.retryCount = 0;
34022
+ window.addEventListener("offline", () => {
34023
+ var _a;
34024
+ this.token = "fake";
34025
+ (_a = this.connection) == null ? void 0 : _a.close();
34026
+ });
34022
34027
  }
34023
34028
  getBaseURL() {
34024
34029
  const parsedURL = new URL(this.url);
@@ -34039,9 +34044,8 @@ ${codeText}
34039
34044
  },
34040
34045
  credentials: "include"
34041
34046
  });
34042
- if (ret.status !== 200) {
34043
- throw new Error("http auth error");
34044
- }
34047
+ if (ret.status !== 200)
34048
+ ;
34045
34049
  if (!this.enabled) {
34046
34050
  return {
34047
34051
  read: "",
@@ -34286,6 +34290,12 @@ ${codeText}
34286
34290
  });
34287
34291
  assert(logger$2m, !this.doc, "This websocket has opened a doc.");
34288
34292
  await this.connection.init(this.auth);
34293
+ window.addEventListener("online", async () => {
34294
+ await this.connection.init({
34295
+ ...this.auth,
34296
+ token: "fake"
34297
+ });
34298
+ });
34289
34299
  const doc2 = this.connection.get(this.auth.appId, this.auth.docId);
34290
34300
  this.doc = doc2;
34291
34301
  await fetchDoc(doc2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "1.1.3-bate.1",
3
+ "version": "1.1.3-bate.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",