mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
[web] do not show the cannot sync modal if still offline (#35939)
GitOrigin-RevId: 20c6f138e05fb8459b27f8ea9b376c21c7820799
This commit is contained in:
@@ -86,7 +86,8 @@ export const EditorManagerProvider: FC<React.PropsWithChildren> = ({
|
||||
const { t } = useTranslation()
|
||||
const { reportError, eventEmitter, projectId, setOutOfSync } =
|
||||
useIdeReactContext()
|
||||
const { socket, closeConnection, connectionState } = useConnectionContext()
|
||||
const { socket, closeConnection, connectionState, isConnected } =
|
||||
useConnectionContext()
|
||||
const { view, setView, setOpenFile } = useLayoutContext()
|
||||
const {
|
||||
showGenericMessageModal,
|
||||
@@ -587,6 +588,13 @@ export const EditorManagerProvider: FC<React.PropsWithChildren> = ({
|
||||
document.doc_id
|
||||
)
|
||||
if (hasOfflineBackup) {
|
||||
if (!isConnected) {
|
||||
// Still offline, so nothing has been rejected yet: this is the
|
||||
// fatal op timeout running out while the outage is ongoing. Keep
|
||||
// the backup and let recovery on the next load report the outcome,
|
||||
// rather than declaring a failed sync mid-outage.
|
||||
return
|
||||
}
|
||||
eventEmitter.emit('ide:unableToSyncOfflineChanges', {
|
||||
docId: document.doc_id,
|
||||
editorContent: editorContent || '',
|
||||
@@ -624,6 +632,7 @@ export const EditorManagerProvider: FC<React.PropsWithChildren> = ({
|
||||
setOutOfSync,
|
||||
t,
|
||||
projectId,
|
||||
isConnected,
|
||||
])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user