From 17c32f0b7d43f418e40eaac9ee6ffa469dc23b93 Mon Sep 17 00:00:00 2001 From: Amit Haridas Date: Sun, 5 Oct 2025 20:34:28 +0530 Subject: [PATCH] Fix file association double-click rendering (v1.6.1) Fixed issue where files opened via double-click were not rendering properly. Added proper wait for renderer load state before sending file data. Co-Authored-By: Claude --- package.json | 2 +- src/main.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e3e2f17..f6e598c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pan-converter", - "version": "1.6.0", + "version": "1.6.1", "description": "Cross-platform Markdown editor and converter using Pandoc", "main": "src/main.js", "scripts": { diff --git a/src/main.js b/src/main.js index 9d30e47..949233b 100644 --- a/src/main.js +++ b/src/main.js @@ -301,7 +301,7 @@ function createMenu() { type: 'info', title: 'About PanConverter', message: 'PanConverter', - detail: 'A cross-platform Markdown editor and converter using Pandoc.\n\nVersion: 1.6.0\nAuthor: Amit Haridas\nEmail: amit.wh@gmail.com\nLicense: MIT\n\nFeatures:\n• Windows Explorer context menu integration\n• Tabbed interface for multiple files\n• Advanced markdown editing with live preview\n• Real-time preview updates while typing\n• Full toolbar markdown editing functions\n• Enhanced PDF export with built-in Electron fallback\n• File association support for .md files\n• Command-line interface for batch conversion\n• Advanced export options with templates and metadata\n• Batch file conversion with progress tracking\n• Improved preview typography and spacing\n• Adjustable font sizes via menu (Ctrl+Shift+Plus/Minus)\n• Complete theme support including Monokai fixes\n• Find & replace with match highlighting\n• Line numbers and auto-indentation\n• Export to multiple formats via Pandoc\n• PowerPoint & presentation export\n• Export tables to Excel/ODS spreadsheets\n• Document import & conversion\n• Table creation helper\n• Multiple themes support\n• Undo/redo functionality\n• Live word count and statistics', + detail: 'A cross-platform Markdown editor and converter using Pandoc.\n\nVersion: 1.6.1\nAuthor: Amit Haridas\nEmail: amit.wh@gmail.com\nLicense: MIT\n\nFeatures:\n• Windows Explorer context menu integration\n• Tabbed interface for multiple files\n• Advanced markdown editing with live preview\n• Real-time preview updates while typing\n• Full toolbar markdown editing functions\n• Enhanced PDF export with built-in Electron fallback\n• File association support for .md files\n• Command-line interface for batch conversion\n• Advanced export options with templates and metadata\n• Batch file conversion with progress tracking\n• Improved preview typography and spacing\n• Adjustable font sizes via menu (Ctrl+Shift+Plus/Minus)\n• Complete theme support including Monokai fixes\n• Find & replace with match highlighting\n• Line numbers and auto-indentation\n• Export to multiple formats via Pandoc\n• PowerPoint & presentation export\n• Export tables to Excel/ODS spreadsheets\n• Document import & conversion\n• Table creation helper\n• Multiple themes support\n• Undo/redo functionality\n• Live word count and statistics', buttons: ['OK'] }); } @@ -1366,7 +1366,14 @@ function openFileFromPath(filePath) { currentFile = filePath; const content = fs.readFileSync(filePath, 'utf-8'); if (mainWindow && mainWindow.webContents) { - mainWindow.webContents.send('file-opened', { path: filePath, content }); + // Wait for the renderer to be fully loaded before sending file data + if (mainWindow.webContents.isLoading()) { + mainWindow.webContents.once('did-finish-load', () => { + mainWindow.webContents.send('file-opened', { path: filePath, content }); + }); + } else { + mainWindow.webContents.send('file-opened', { path: filePath, content }); + } } } } \ No newline at end of file