Skip to content

Commit

Permalink
latest pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
RonaldsonBellande committed Feb 3, 2024
1 parent 4c3cf62 commit 6d9d5cd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions scripts/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { app, BrowserWindow } = require('electron');
const { app, BrowserWindow, Menu } = require('electron');

// Application configuration
const appConfig = {
Expand All @@ -24,7 +24,30 @@ async function createMainWindow() {
},
});

await mainWindow.loadURL(appConfig.homePageURL);
try {
await mainWindow.loadURL(appConfig.homePageURL);
} catch (error) {
console.error('Error loading URL:', error.message);
}

// Create default menu template with only the 'HomePage' section
const template = [
{
label: 'HomePage',
click: async () => {
try {
await mainWindow.loadURL(appConfig.homePageURL);
} catch (error) {
console.error('Error loading URL:', error.message);
}
},
},
];

// Set the custom menu
const menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);

return mainWindow;
}

Expand Down

0 comments on commit 6d9d5cd

Please sign in to comment.