Skip to content

Commit

Permalink
only include revisionId when available
Browse files Browse the repository at this point in the history
also remove console.log
  • Loading branch information
scytacki committed Oct 29, 2024
1 parent cded52d commit 77bbda9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 8 additions & 3 deletions v3/src/models/app-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@ class AppState {
async getDocumentSnapshot() {
// use cloneDeep because MST snapshots are immutable
const snapshot = await serializeDocument(this.currentDocument, doc => cloneDeep(getSnapshot(doc)))
return {
revisionId: this.document.treeManagerAPI?.revisionId,
...snapshot
const revisionId = this.document.treeManagerAPI?.revisionId
if (revisionId) {
return {

Check warning on line 59 in v3/src/models/app-state.ts

View check run for this annotation

Codecov / codecov/patch

v3/src/models/app-state.ts#L59

Added line #L59 was not covered by tests
revisionId: this.document.treeManagerAPI?.revisionId,
...snapshot
}
}

return snapshot
}

setCFM(cfm: CloudFileManager) {
Expand Down
1 change: 0 additions & 1 deletion v3/src/models/history/tree-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ export const TreeManager = types
self.document.history.push(entry)

// Store the most recent history id.
console.log("RevisionId", entry.id)
self.revisionId = entry.id

// Add the entry to the undo stack if it is undoable.
Expand Down

0 comments on commit 77bbda9

Please sign in to comment.