From 6d9d5cd06240ccd68bd9e3b949b2ce63b2d4696a Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Sat, 3 Feb 2024 17:24:52 -0500 Subject: [PATCH] latest pushes --- ..._robotics_sensors_website_application.yaml | 0 scripts/index.js | 27 +++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 com.bellande_robotics_sensors_research_innovations.organization_robotics_sensors_website_application.yaml diff --git a/com.bellande_robotics_sensors_research_innovations.organization_robotics_sensors_website_application.yaml b/com.bellande_robotics_sensors_research_innovations.organization_robotics_sensors_website_application.yaml new file mode 100644 index 0000000..e69de29 diff --git a/scripts/index.js b/scripts/index.js index 3a3b1c6..a9d2f9c 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -1,4 +1,4 @@ -const { app, BrowserWindow } = require('electron'); +const { app, BrowserWindow, Menu } = require('electron'); // Application configuration const appConfig = { @@ -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; }