diff --git a/services/web/frontend/js/features/ide-react/components/modals/unable-to-sync-modal.tsx b/services/web/frontend/js/features/ide-react/components/modals/unable-to-sync-modal.tsx index c729b1a263..9c18238162 100644 --- a/services/web/frontend/js/features/ide-react/components/modals/unable-to-sync-modal.tsx +++ b/services/web/frontend/js/features/ide-react/components/modals/unable-to-sync-modal.tsx @@ -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 () => { diff --git a/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx b/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx index 4647f33fef..76e1687649 100644 --- a/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx +++ b/services/web/frontend/js/features/ide-react/context/editor-manager-context.tsx @@ -645,12 +645,19 @@ export const EditorManagerProvider: FC = ({ useEffect(() => { const handleUnableToSync = ({ - detail: [{ editorContent, baseContent, docName, reloadAfterClose }], + detail: [ + { docId, editorContent, baseContent, docName, reloadAfterClose }, + ], }: CustomEvent) => { + const resolvedDocName = + docName || + (fileTreeDataRef.current && + findDocEntityById(fileTreeDataRef.current, docId)?.name) || + null showUnableToSyncModal({ baseContent, targetContent: editorContent, - docName, + docName: resolvedDocName, rootFolderId: fileTreeDataRef.current?._id, reloadAfterClose, })