[web] avoid accessing the sharejs snapshot directly (#25037)
* [web] avoid accessing the sharejs snapshot directly * [web] limit API interface for sharejs types GitOrigin-RevId: faece372128e4580376e32fa93aa8fedf1e02957
This commit is contained in:
@@ -580,7 +580,7 @@ export const EditorManagerProvider: FC = ({ children }) => {
|
||||
editorContent =
|
||||
typeof editorContent === 'string'
|
||||
? editorContent
|
||||
: document.doc?._doc.snapshot
|
||||
: document.getSnapshot()
|
||||
|
||||
// Tear down the ShareJsDoc.
|
||||
if (document.doc) document.doc.clearInflightAndPendingOps()
|
||||
|
||||
@@ -60,7 +60,7 @@ export const ReferencesProvider: FC = ({ children }) => {
|
||||
// avoid reindexing references if the bib file has not changed since the
|
||||
// last time they were indexed
|
||||
const docId = doc.doc_id
|
||||
const snapshot = doc._doc.snapshot
|
||||
const snapshot = doc.getSnapshot()
|
||||
const now = Date.now()
|
||||
const sha1 = generateSHA1Hash(
|
||||
'blob ' + snapshot.length + '\x00' + snapshot
|
||||
|
||||
Reference in New Issue
Block a user