From 415d6a9cbfcd17a2a26d2354a72b58ce0124fc2c Mon Sep 17 00:00:00 2001 From: hmcclew <122323895+hmcclew@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:24:06 -0500 Subject: [PATCH] electron versioning --- .github/workflows/backend.yaml | 2 +- frontend/electron.js | 13 +++++++++++-- frontend/package-lock.json | 8 ++++---- frontend/package.json | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/backend.yaml b/.github/workflows/backend.yaml index 9704e12..cfa528e 100644 --- a/.github/workflows/backend.yaml +++ b/.github/workflows/backend.yaml @@ -23,7 +23,7 @@ jobs: - name: Cmake Build working-directory: backend/build - run: cmake -DOpenCASCADE_DIR=/usr/local/Cellar/opencascade/7.7.2_2/lib/cmake/opencascade .. + run: cmake .. - name: Build Backend Project working-directory: backend/build diff --git a/frontend/electron.js b/frontend/electron.js index 5a26f02..2dd656d 100644 --- a/frontend/electron.js +++ b/frontend/electron.js @@ -2,6 +2,14 @@ const { app, BrowserWindow } = require('electron'); const path = require('path'); const isDev = require('electron-is-dev'); +if (app.setNSApplicationDelegate) { + app.setNSApplicationDelegate({ + applicationSupportsSecureRestorableState: () => true, + }); +} else { + console.warn("NSApplicationDelegate is not supported on this platform."); +} + let mainWindow; function createWindow() { @@ -15,10 +23,11 @@ function createWindow() { }, }); + // Use 127.0.0.1 instead of localhost const startURL = isDev - ? 'http://localhost:3000' + ? 'http://127.0.0.1:3000' : `file://${path.join(__dirname, '../build/index.html')}`; - + mainWindow.loadURL(startURL); mainWindow.on('closed', () => (mainWindow = null)); diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 9d61c6e..0bb5889 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -22,7 +22,7 @@ "@types/electron": "^1.6.10", "@types/react": "^18.2.53", "@types/react-dom": "^18.2.18", - "electron": "^28.1.1", + "electron": "^28.2.3", "electron-builder": "^24.9.1", "electron-is-dev": "^2.0.0", "tailwindcss": "^3.4.1", @@ -8230,9 +8230,9 @@ } }, "node_modules/electron": { - "version": "28.1.1", - "resolved": "https://registry.npmjs.org/electron/-/electron-28.1.1.tgz", - "integrity": "sha512-HJSbGHpRl46jWCp5G4OH57KSm2F5u15tB10ixD8iFiz9dhwojqlSQTRAcjSwvga+Vqs1jv7iqwQRrolXP4DgOA==", + "version": "28.2.3", + "resolved": "https://registry.npmjs.org/electron/-/electron-28.2.3.tgz", + "integrity": "sha512-he9nGphZo03ejDjYBXpmFVw0KBKogXvR2tYxE4dyYvnfw42uaFIBFrwGeenvqoEOfheJfcI0u4rFG6h3QxDwnA==", "dev": true, "hasInstallScript": true, "dependencies": { diff --git a/frontend/package.json b/frontend/package.json index 9142521..b929294 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -51,7 +51,7 @@ "@types/electron": "^1.6.10", "@types/react": "^18.2.53", "@types/react-dom": "^18.2.18", - "electron": "^28.1.1", + "electron": "^28.2.3", "electron-builder": "^24.9.1", "electron-is-dev": "^2.0.0", "tailwindcss": "^3.4.1",