mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
fix(renderer): ensure tab content visibility after file open
- Add missing updateUI() call at end of openFile() to set .active class
on tab content. Without this, the CSS rule .tab-content:not(.active)
{ display: none } kept newly opened files invisible.
- Add diagnostic logging to file-opened IPC handler and openFile()
to trace future file loading issues.
- Add diagnostic logging to openFileFromPath() in main process.
Amit Haridas
This commit is contained in:
+2
-1
@@ -3759,7 +3759,7 @@ app.on('open-file', (event, filePath) => {
|
||||
// Handle file opening from command line or file association
|
||||
function openFileFromPath(filePath) {
|
||||
console.log('[MAIN] openFileFromPath called with:', filePath);
|
||||
console.log('[MAIN] rendererReady:', rendererReady, 'mainWindow exists:', !!mainWindow);
|
||||
console.log('[MAIN] rendererReady:', rendererReady, 'mainWindow exists:', !!mainWindow, 'webContents exists:', !!(mainWindow?.webContents));
|
||||
if (fs.existsSync(filePath)) {
|
||||
const stats = fs.statSync(filePath);
|
||||
if (stats.size > MAX_FILE_SIZE) {
|
||||
@@ -3769,6 +3769,7 @@ function openFileFromPath(filePath) {
|
||||
currentFile = filePath;
|
||||
const content = fs.readFileSync(filePath, 'utf-8');
|
||||
console.log('[MAIN] File read successfully, content length:', content.length);
|
||||
console.log('[MAIN] About to send file-opened. mainWindow:', !!mainWindow, 'webContents:', !!(mainWindow?.webContents), 'rendererReady:', rendererReady);
|
||||
if (mainWindow && mainWindow.webContents && rendererReady) {
|
||||
// Send file immediately - renderer-ready means UI is initialized
|
||||
console.log('[MAIN] Sending file-opened to renderer');
|
||||
|
||||
Reference in New Issue
Block a user