Merge pull request #35725 from overleaf/ds-unable-to-sync-modal

[WEB] adds unable-to-sync modal for intermittent connection improvements

GitOrigin-RevId: 4cd85cf742cb3f36cc0c97f83bdeab09bb6f7c53
This commit is contained in:
Davinder Singh
2026-09-17 11:36:54 +00:00
committed by Copybot
parent 02d36687cd
commit e0a2af4bf6
6 changed files with 108 additions and 9 deletions
@@ -3,6 +3,7 @@ import { useCodeMirrorViewContext } from '../codemirror-context'
import { useCallback } from 'react'
import { useEditorOpenDocContext } from '@/features/ide-react/context/editor-open-doc-context'
import { useTranslation } from 'react-i18next'
import { downloadFileContent } from '@/utils/download-file'
const DownloadFileButton = () => {
const view = useCodeMirrorViewContext()
@@ -11,15 +12,7 @@ const DownloadFileButton = () => {
const downloadFile = useCallback(() => {
const doc = view.state.doc.toString()
const blob = new Blob([doc], { type: 'application/octet-stream' })
const url = URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = openDocName ?? 'document.txt'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
setTimeout(() => URL.revokeObjectURL(url), 0)
downloadFileContent(doc, openDocName ?? 'document.txt')
}, [view, openDocName])
return (