Skip to content

Commit 6d9d5cd

Browse files
latest pushes
1 parent 4c3cf62 commit 6d9d5cd

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

com.bellande_robotics_sensors_research_innovations.organization_robotics_sensors_website_application.yaml

Whitespace-only changes.

scripts/index.js

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { app, BrowserWindow } = require('electron');
1+
const { app, BrowserWindow, Menu } = require('electron');
22

33
// Application configuration
44
const appConfig = {
@@ -24,7 +24,30 @@ async function createMainWindow() {
2424
},
2525
});
2626

27-
await mainWindow.loadURL(appConfig.homePageURL);
27+
try {
28+
await mainWindow.loadURL(appConfig.homePageURL);
29+
} catch (error) {
30+
console.error('Error loading URL:', error.message);
31+
}
32+
33+
// Create default menu template with only the 'HomePage' section
34+
const template = [
35+
{
36+
label: 'HomePage',
37+
click: async () => {
38+
try {
39+
await mainWindow.loadURL(appConfig.homePageURL);
40+
} catch (error) {
41+
console.error('Error loading URL:', error.message);
42+
}
43+
},
44+
},
45+
];
46+
47+
// Set the custom menu
48+
const menu = Menu.buildFromTemplate(template);
49+
Menu.setApplicationMenu(menu);
50+
2851
return mainWindow;
2952
}
3053

0 commit comments

Comments
 (0)