mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
fix download filename in unable-to-sync modal error message (#36113)
GitOrigin-RevId: fdc891962b24a096a1d54a73fcb0d7af6d504729
This commit is contained in:
+1
-1
@@ -83,7 +83,7 @@ function UnableToSyncModal({
|
||||
|
||||
const handleDownload = useCallback(() => {
|
||||
sendMB('unable-to-sync-modal-click', { action: 'download' })
|
||||
downloadFileContent(targetContent, docName ?? 'document.txt')
|
||||
downloadFileContent(targetContent, docName || 'document.txt')
|
||||
}, [targetContent, docName])
|
||||
|
||||
const handleSaveAsNewFile = useCallback(async () => {
|
||||
|
||||
@@ -645,12 +645,19 @@ export const EditorManagerProvider: FC<React.PropsWithChildren> = ({
|
||||
|
||||
useEffect(() => {
|
||||
const handleUnableToSync = ({
|
||||
detail: [{ editorContent, baseContent, docName, reloadAfterClose }],
|
||||
detail: [
|
||||
{ docId, editorContent, baseContent, docName, reloadAfterClose },
|
||||
],
|
||||
}: CustomEvent<IdeEvents['ide:unableToSyncOfflineChanges']>) => {
|
||||
const resolvedDocName =
|
||||
docName ||
|
||||
(fileTreeDataRef.current &&
|
||||
findDocEntityById(fileTreeDataRef.current, docId)?.name) ||
|
||||
null
|
||||
showUnableToSyncModal({
|
||||
baseContent,
|
||||
targetContent: editorContent,
|
||||
docName,
|
||||
docName: resolvedDocName,
|
||||
rootFolderId: fileTreeDataRef.current?._id,
|
||||
reloadAfterClose,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user