Skip to content

Commit

Permalink
Merge pull request #522 from ubilabs/feat/electron-cosmetics
Browse files Browse the repository at this point in the history
Feat/electron cosmetics
  • Loading branch information
mrMetalWood authored Aug 26, 2020
2 parents e6cdb96 + abf975b commit 85047d1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
4 changes: 3 additions & 1 deletion electron-builder.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"directories": {
"output": "dist-electron"
"output": "dist-electron",
"buildResources": "electron-resources"
},
"appId": "com.ubilabs.esa.cfs",
"productName": "ESA – Climate from Space",
"files": ["./dist-src-electron/*", "./dist/**/*"],
"win": {
"target": "portable"
Expand Down
Binary file added electron-resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@types/redux-logger": "^3.0.7",
"cesium": "^1.66.0",
"cross-zip": "^3.0.0",
"electron-is-dev": "^1.2.0",
"framer-motion": "^1.8.4",
"lodash.debounce": "^4.0.8",
"lodash.intersection": "^4.4.0",
Expand Down Expand Up @@ -75,7 +76,7 @@
"conventional-changelog-cli": "^2.0.31",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.4.2",
"electron": "^9.1.1",
"electron": "^10.0.0",
"electron-builder": "^22.7.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
Expand Down
9 changes: 7 additions & 2 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as path from 'path';
import {app, BrowserWindow} from 'electron';
const isDev = require('electron-is-dev');
import {addDownloadHandler} from './download-handler.js';

// future proof for electron 9 and prevent annoying deprecation warning message
Expand All @@ -12,10 +13,12 @@ function createWindow() {
const window = new BrowserWindow({
width: 1400,
height: 800,
title: 'ESA – Climate from Space',
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
preload: path.join(__dirname, 'preload.js')
preload: path.join(__dirname, 'preload.js'),
enableRemoteModule: true
}
});

Expand All @@ -31,7 +34,9 @@ function createWindow() {
const indexPath = `file://${__dirname}/../dist/index.html`;
window.loadURL(indexPath);

window.webContents.openDevTools();
if (isDev) {
window.webContents.openDevTools();
}

// free window reference when closed
window.on('closed', () => {
Expand Down

0 comments on commit 85047d1

Please sign in to comment.