@inditextech/weave-store-standalone 2.8.0 → 2.9.0

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/client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as Y from "yjs";
2
- import { WeaveStore, defaultInitialState } from "@inditextech/weave-sdk/server";
3
- import "@inditextech/weave-types";
2
+ import { WeaveStore, defaultInitialState } from "@inditextech/weave-sdk";
3
+ import { WEAVE_STORE_CONNECTION_STATUS } from "@inditextech/weave-types";
4
4
 
5
5
  //#region src/yjs.ts
6
6
  var yjs_default = Y;
@@ -20,11 +20,15 @@ var WeaveStoreStandalone = class extends WeaveStore {
20
20
  this.initialState = initialState ?? defaultInitialState;
21
21
  }
22
22
  async connect() {
23
- const roomDataSnapshot = Buffer.from(this.roomData, "base64");
24
- if (roomDataSnapshot) yjs_default.applyUpdate(this.getDocument(), roomDataSnapshot);
25
- else this.initialState(this.getDocument());
23
+ if (this.roomData) {
24
+ const roomDataSnapshot = Buffer.from(this.roomData, "base64");
25
+ yjs_default.applyUpdate(this.getDocument(), roomDataSnapshot);
26
+ } else this.initialState(this.getDocument());
27
+ this.handleConnectionStatusChange(WEAVE_STORE_CONNECTION_STATUS.CONNECTED);
28
+ }
29
+ disconnect() {
30
+ this.handleConnectionStatusChange(WEAVE_STORE_CONNECTION_STATUS.DISCONNECTED);
26
31
  }
27
- disconnect() {}
28
32
  handleAwarenessChange() {}
29
33
  setAwarenessInfo() {}
30
34
  };