fix download filename in unable-to-sync modal error message (#36113)

GitOrigin-RevId: fdc891962b24a096a1d54a73fcb0d7af6d504729
This commit is contained in:
Davinder Singh
2026-09-17 11:48:02 +00:00
committed by Copybot
parent b04bdd2944
commit a0c923aea8
2 changed files with 10 additions and 3 deletions
@@ -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,
})