Update main.js

This commit is contained in:
Anirudh Sevugan 2025-02-28 00:08:49 +05:30 committed by GitHub
parent 642eb2f417
commit cc64b6969f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -187,7 +187,7 @@ app.whenReady().then(() => {
// Store file argument but don't open immediately
const args = process.argv.slice(1);
const fileArg = args.find(arg => !arg.startsWith('-') && !arg.includes('electron'));
const fileArg = args.find(isValidFileArg); // Use the filtering function
setTimeout(() => {
if (fileArg) openFileSafely(fileArg); // ✅ Open only after window is ready