mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 14:19:01 +02:00
Merge pull request #3478 from overleaf/jpa-preseve-out-of-sync-trigger
[frontend] preserve the error handler that powers the out-of-sync modal GitOrigin-RevId: 759ede691658d42cedec7c984b284e45d5c776e9
This commit is contained in:
@@ -221,6 +221,8 @@ export default (EditorManager = (function() {
|
||||
|
||||
// Do not trigger any UI changes from remote operations
|
||||
this._unbindFromDocumentEvents(current_sharejs_doc)
|
||||
// Keep listening for out-of-sync and similar errors.
|
||||
this._attachErrorHandlerToDocument(doc, current_sharejs_doc)
|
||||
|
||||
// Teardown the Document -> ShareJsDoc -> sharejs doc
|
||||
// By the time this completes, the Document instance is no longer
|
||||
@@ -278,7 +280,7 @@ export default (EditorManager = (function() {
|
||||
})
|
||||
}
|
||||
|
||||
_bindToDocumentEvents(doc, sharejs_doc) {
|
||||
_attachErrorHandlerToDocument(doc, sharejs_doc) {
|
||||
sharejs_doc.on('error', (error, meta, editorContent) => {
|
||||
let message
|
||||
if ((error != null ? error.message : undefined) != null) {
|
||||
@@ -314,6 +316,10 @@ export default (EditorManager = (function() {
|
||||
removeHandler()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
_bindToDocumentEvents(doc, sharejs_doc) {
|
||||
this._attachErrorHandlerToDocument(doc, sharejs_doc)
|
||||
|
||||
return sharejs_doc.on('externalUpdate', update => {
|
||||
if (this._ignoreExternalUpdates) {
|
||||
|
||||
Reference in New Issue
Block a user