mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Merge pull request #36074 from overleaf/mj-reload-after-failed-catch-up
[web] Reload after failed intermittent-connection catchup GitOrigin-RevId: c9a6315ecb6ebe957ad85c05ebc84bb8165881ab
This commit is contained in:
committed by
Copybot
parent
35ba44f22b
commit
d1691345c5
@@ -606,6 +606,7 @@ export const EditorManagerProvider: FC<React.PropsWithChildren> = ({
|
||||
editorContent: editorContent || '',
|
||||
baseContent: backupRecord.snapshot,
|
||||
docName: document.docName,
|
||||
reloadAfterClose: true,
|
||||
})
|
||||
OfflineDocBackup.remove(projectId, document.doc_id)
|
||||
} else {
|
||||
@@ -644,13 +645,14 @@ export const EditorManagerProvider: FC<React.PropsWithChildren> = ({
|
||||
|
||||
useEffect(() => {
|
||||
const handleUnableToSync = ({
|
||||
detail: [{ editorContent, baseContent, docName }],
|
||||
detail: [{ editorContent, baseContent, docName, reloadAfterClose }],
|
||||
}: CustomEvent<IdeEvents['ide:unableToSyncOfflineChanges']>) => {
|
||||
showUnableToSyncModal({
|
||||
baseContent,
|
||||
targetContent: editorContent,
|
||||
docName,
|
||||
rootFolderId: fileTreeDataRef.current?._id,
|
||||
reloadAfterClose,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,11 @@ type ModalsContextValue = {
|
||||
showUnableToSyncModal: (
|
||||
data: Pick<
|
||||
UnableToSyncModalProps,
|
||||
'baseContent' | 'targetContent' | 'docName' | 'rootFolderId'
|
||||
| 'baseContent'
|
||||
| 'targetContent'
|
||||
| 'docName'
|
||||
| 'rootFolderId'
|
||||
| 'reloadAfterClose'
|
||||
>
|
||||
) => void
|
||||
}
|
||||
@@ -64,13 +68,18 @@ export const ModalsContextProvider: FC<React.PropsWithChildren> = ({
|
||||
const [unableToSyncModalData, setUnableToSyncModalData] = useState<
|
||||
Pick<
|
||||
UnableToSyncModalProps,
|
||||
'baseContent' | 'targetContent' | 'docName' | 'rootFolderId'
|
||||
| 'baseContent'
|
||||
| 'targetContent'
|
||||
| 'docName'
|
||||
| 'rootFolderId'
|
||||
| 'reloadAfterClose'
|
||||
>
|
||||
>({
|
||||
baseContent: '',
|
||||
targetContent: '',
|
||||
docName: null,
|
||||
rootFolderId: undefined,
|
||||
reloadAfterClose: undefined,
|
||||
})
|
||||
|
||||
const handleHideGenericModal = useCallback(() => {
|
||||
@@ -122,7 +131,11 @@ export const ModalsContextProvider: FC<React.PropsWithChildren> = ({
|
||||
(
|
||||
data: Pick<
|
||||
UnableToSyncModalProps,
|
||||
'baseContent' | 'targetContent' | 'docName' | 'rootFolderId'
|
||||
| 'baseContent'
|
||||
| 'targetContent'
|
||||
| 'docName'
|
||||
| 'rootFolderId'
|
||||
| 'reloadAfterClose'
|
||||
>
|
||||
) => {
|
||||
setUnableToSyncModalData(data)
|
||||
|
||||
Reference in New Issue
Block a user