fix: v0.2.5 一致性与边角修复 - 右键菜单边缘防溢出、粘贴10MB防护、拖拽失败提示、多文件提示、剪贴板走主进程IPC、主进程异步读取

This commit is contained in:
2026-08-17 21:29:17 +08:00
parent 4ee5d62348
commit 9345de1716
13 changed files with 158 additions and 56 deletions
+2 -2
View File
@@ -102,11 +102,11 @@ ipcMain.handle('file:open', async (_event, side: 'left' | 'right' | null) => {
const name = filePath.split(/[\\/]/).pop() ?? filePath
let buf: Buffer
try {
const stat = fs.statSync(filePath)
const stat = await fs.promises.stat(filePath)
if (stat.size > MAX_FILE_SIZE) {
return { error: 'too-large', name, size: stat.size }
}
buf = fs.readFileSync(filePath)
buf = await fs.promises.readFile(filePath)
} catch {
return { error: 'read-failed', name }
}