mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-17 07:11:17 +00: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:
parent
2200221820
commit
62dd773629
1 changed files with 7 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue