mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
Merge pull request #3483 from overleaf/jpa-leave-on-out-of-sync
[frontend] displaying the out-of-sync modal is a dead end GitOrigin-RevId: 475bf851c9f07bb2a7b052879b98756881de44a2
This commit is contained in:
@@ -302,15 +302,30 @@ export default (EditorManager = (function() {
|
||||
'Sorry, this file has too many comments or tracked changes. Please try accepting or rejecting some existing changes, or resolving and deleting some comments.'
|
||||
)
|
||||
} else {
|
||||
// Do not allow this doc to open another error modal.
|
||||
sharejs_doc.off('error')
|
||||
|
||||
// Preserve the sharejs contents before the teardown.
|
||||
editorContent =
|
||||
typeof editorContent === 'string'
|
||||
? editorContent
|
||||
: sharejs_doc.doc._doc.snapshot
|
||||
|
||||
// Tear down the ShareJsDoc.
|
||||
if (sharejs_doc.doc) sharejs_doc.doc.clearInflightAndPendingOps()
|
||||
|
||||
// Do not re-join after re-connecting.
|
||||
sharejs_doc.leaveAndCleanUp()
|
||||
|
||||
this.ide.socket.disconnect()
|
||||
this.ide.reportError(error, meta)
|
||||
this.ide.showOutOfSyncModal(
|
||||
'Out of sync',
|
||||
"Sorry, this file has gone out of sync and we need to do a full refresh. <br> <a href='/learn/Kb/Editor_out_of_sync_problems'>Please see this help guide for more information</a>",
|
||||
typeof editorContent === 'string'
|
||||
? editorContent
|
||||
: sharejs_doc.doc._doc.snapshot
|
||||
editorContent
|
||||
)
|
||||
// Do not forceReopen the document.
|
||||
return
|
||||
}
|
||||
const removeHandler = this.$scope.$on('project:joined', () => {
|
||||
this.openDoc(doc, { forceReopen: true })
|
||||
|
||||
@@ -270,6 +270,7 @@ export default (ShareJsDoc = (function() {
|
||||
}
|
||||
|
||||
clearInflightAndPendingOps() {
|
||||
this._clearFatalTimeoutTimer()
|
||||
this._doc.inflightOp = null
|
||||
this._doc.inflightCallbacks = []
|
||||
this._doc.pendingOp = null
|
||||
|
||||
Reference in New Issue
Block a user