mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-10-01 17:29:29 +05:30
fix(preload): saveFile IPC payload was being shadowed by stray channel arg
C9 (22bc4dc) introduced a malformed edit when wiring openFile. The
saveFile arrow got a stray 'open-text-file-dialog' string between the
channel and payload, so the ipcMain handler destructured the string
(both fields undefined) instead of { content, defaultName }. saveFile
silently saved with no content and no default name — the Save to File
button worked through the dialog fallback but wrote whatever was in
the buffer.
Fix: drop the stray arg, restore the single-line invoke with the
payload object. openFile stays on its own line below. format:check
is now clean.
Discovered during the v4.13.0 release rebuild when prettier wanted
to collapse the malformed multi-line into one — the malformed shape
itself was the bug, not the formatting.
Amit Haridas
This commit is contained in:
+1
-2
@@ -567,8 +567,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||||||
readFile: (p) => ipcRenderer.invoke('read-text-file', p),
|
readFile: (p) => ipcRenderer.invoke('read-text-file', p),
|
||||||
writeFile: (p, content) => ipcRenderer.invoke('write-text-file', { path: p, content }),
|
writeFile: (p, content) => ipcRenderer.invoke('write-text-file', { path: p, content }),
|
||||||
saveFile: (content, defaultName) =>
|
saveFile: (content, defaultName) =>
|
||||||
ipcRenderer.invoke('save-text-file',
|
ipcRenderer.invoke('save-text-file', { content, defaultName }),
|
||||||
'open-text-file-dialog', { content, defaultName }),
|
|
||||||
openFile: () => ipcRenderer.invoke('open-text-file-dialog'),
|
openFile: () => ipcRenderer.invoke('open-text-file-dialog'),
|
||||||
insertAtCursor: (text) => ipcRenderer.send('insert-content', text),
|
insertAtCursor: (text) => ipcRenderer.send('insert-content', text),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user