Skip to content

Commit

Permalink
Merge pull request #5 from xanmoy/dev
Browse files Browse the repository at this point in the history
fix: resolve issue with filemanager
  • Loading branch information
xanmoy authored Nov 17, 2024
2 parents fddd2d6 + 75dc034 commit a7f76a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ copyright @ Tanmoy Ganguly
import { app, BrowserWindow, shell } from 'electron';
import path from 'path';
import { config } from './config/index.js';
import { fileURLToPath } from 'url'; // <-- Import `fileURLToPath` from 'url'

// Dynamically import the context menu module
import('electron-context-menu').then((contextMenu) => {
Expand All @@ -39,10 +40,10 @@ function onNewWindow(details) {
return { action: 'deny' };
}

const createWindow = () => {
// Calculate __dirname for ES modules
const __dirname = path.dirname(new URL(import.meta.url).pathname);
// Calculate __dirname for ES modules
const __dirname = path.dirname(fileURLToPath(import.meta.url)); // <-- Updated: Calculate `__dirname` directly

const createWindow = () => {
window = new BrowserWindow({
icon: path.join(__dirname, 'assets/icon.png'),
autoHideMenuBar: true
Expand Down

0 comments on commit a7f76a7

Please sign in to comment.