mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #6705 from overleaf/ta-ms-doc-too-long-modal
Improve handling of "Document Too Long" Errors GitOrigin-RevId: 6a5e200014609e2a94f896840757487564d41176
This commit is contained in:
parent
9049691f42
commit
4a70dfa921
1 changed files with 8 additions and 2 deletions
|
@ -40,6 +40,7 @@ export default EditorManager = (function () {
|
||||||
opening: true,
|
opening: true,
|
||||||
trackChanges: false,
|
trackChanges: false,
|
||||||
wantTrackChanges: false,
|
wantTrackChanges: false,
|
||||||
|
docTooLongErrorShown: false,
|
||||||
showRichText: this.showRichText(),
|
showRichText: this.showRichText(),
|
||||||
newSourceEditor: this.newSourceEditor(),
|
newSourceEditor: this.newSourceEditor(),
|
||||||
showSymbolPalette: false,
|
showSymbolPalette: false,
|
||||||
|
@ -334,16 +335,21 @@ export default EditorManager = (function () {
|
||||||
message = ''
|
message = ''
|
||||||
}
|
}
|
||||||
if (/maxDocLength/.test(message)) {
|
if (/maxDocLength/.test(message)) {
|
||||||
this.ide.showGenericMessageModal(
|
this.$scope.docTooLongErrorShown = true
|
||||||
|
this.openDoc(doc, { forceReopen: true })
|
||||||
|
const genericMessageModal = this.ide.showGenericMessageModal(
|
||||||
'Document Too Long',
|
'Document Too Long',
|
||||||
'Sorry, this file is too long to be edited manually. Please upload it directly.'
|
'Sorry, this file is too long to be edited manually. Please upload it directly.'
|
||||||
)
|
)
|
||||||
|
genericMessageModal.result.finally(() => {
|
||||||
|
this.$scope.docTooLongErrorShown = false
|
||||||
|
})
|
||||||
} else if (/too many comments or tracked changes/.test(message)) {
|
} else if (/too many comments or tracked changes/.test(message)) {
|
||||||
this.ide.showGenericMessageModal(
|
this.ide.showGenericMessageModal(
|
||||||
'Too many comments or tracked changes',
|
'Too many comments or tracked changes',
|
||||||
'Sorry, this file has too many comments or tracked changes. Please try accepting or rejecting some existing changes, or resolving and deleting some comments.'
|
'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 {
|
} else if (!this.$scope.docTooLongErrorShown) {
|
||||||
// Do not allow this doc to open another error modal.
|
// Do not allow this doc to open another error modal.
|
||||||
sharejs_doc.off('error')
|
sharejs_doc.off('error')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue