From a0c923aea8bdcde57ae54bc7ffc07d0e64d244ef Mon Sep 17 00:00:00 2001 From: Davinder Singh Date: Wed, 5 Aug 2026 09:17:20 +0100 Subject: [PATCH] fix download filename in unable-to-sync modal error message (#36113) GitOrigin-RevId: fdc891962b24a096a1d54a73fcb0d7af6d504729 --- .../components/modals/unable-to-sync-modal.tsx | 2 +- .../ide-react/context/editor-manager-context.tsx | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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, })