summaryrefslogtreecommitdiff
path: root/src/main/index.ts
diff options
context:
space:
mode:
authorhaoyuren <13851610112@163.com>2026-03-13 16:56:13 -0500
committerhaoyuren <13851610112@163.com>2026-03-13 16:56:13 -0500
commit2d268365bc1f9f9b550812a8aa406b7abc005497 (patch)
treebbdd21c471e493573823af95ee651cc39297d82e /src/main/index.ts
parentc309944494eb2de63bf9b35ea722d50b52e688a3 (diff)
Add bidirectional sync for binary files (PDF, images, etc.)
FileSyncBridge now handles binary fileRefs in addition to text docs: - Downloads all binary files to temp dir on project connect - Watches for binary file changes on disk and uploads via REST API - Listens for Overleaf socket events (reciveNewFile, reciveNewDoc, removeEntity, reciveEntityRename) to sync remote changes to disk - Tracks binary files by SHA1 hash to avoid redundant uploads Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/main/index.ts')
-rw-r--r--src/main/index.ts3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/index.ts b/src/main/index.ts
index 7d70238..0d93b17 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -4,7 +4,6 @@
import { app, BrowserWindow, ipcMain, dialog, shell, net } from 'electron'
import { join, basename } from 'path'
import { readFile, writeFile } from 'fs/promises'
-import { createReadStream } from 'fs'
import { spawn } from 'child_process'
import * as pty from 'node-pty'
import { OverleafSocket, type RootFolder, type SubFolder, type JoinDocResult } from './overleafSocket'
@@ -650,7 +649,7 @@ ipcMain.handle('ot:connect', async (_e, projectId: string) => {
// Set up file sync bridge for bidirectional sync
const tmpDir = compilationManager.dir
- fileSyncBridge = new FileSyncBridge(overleafSock, tmpDir, docPathMap, pathDocMap, mainWindow!)
+ fileSyncBridge = new FileSyncBridge(overleafSock, tmpDir, docPathMap, pathDocMap, fileRefs, mainWindow!, projectId, overleafSessionCookie, overleafCsrfToken)
fileSyncBridge.start().catch((e) => {
console.log('[ot:connect] fileSyncBridge start error:', e)
})