@supernova-studio/client 0.47.65 → 0.47.67

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/client",
3
- "version": "0.47.65",
3
+ "version": "0.47.67",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -126,10 +126,6 @@ export class FrontendVersionRoomYDoc {
126
126
  const result = new Map<string, DTODocumentationDraftState>();
127
127
 
128
128
  pages.forEach(page => {
129
- // Current state
130
- const currentPageContentHash = pageHashes[page.persistentId] ?? "";
131
- const currentState: ItemState = this.itemStateFromPage(page, currentPageContentHash);
132
-
133
129
  // Published state
134
130
  const snapshot = publishedSnapshotsByPageId.get(page.id);
135
131
  let publishedState: ItemState | undefined;
@@ -138,6 +134,10 @@ export class FrontendVersionRoomYDoc {
138
134
  publishedState = this.itemStateFromPage(publishedPage, snapshot.pageContentHash);
139
135
  }
140
136
 
137
+ // Current state - if content hash is undefined, it means that the page hasn't changed
138
+ const currentPageContentHash = pageHashes[page.persistentId] ?? snapshot?.pageContentHash ?? "";
139
+ const currentState: ItemState = this.itemStateFromPage(page, currentPageContentHash);
140
+
141
141
  // Calculate draft
142
142
  const draftState = this.createDraftState(page.persistentId, currentState, publishedState);
143
143
  if (draftState) result.set(page.id, draftState);