Update dependencies

This commit is contained in:
Matthias Schiffer 2019-12-24 14:25:03 +01:00
parent 3c51a1994f
commit 53c1852757
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
5 changed files with 2685 additions and 2628 deletions

View file

@ -4,6 +4,7 @@ import { format as formatUrl } from 'url';
const isDevelopment = process.env.NODE_ENV !== 'production';
// global reference to mainWindow (necessary to prevent window from being garbage collected)
let mainWindow: BrowserWindow|null = null;
function getIndexURL(): string {
@ -18,7 +19,7 @@ function getIndexURL(): string {
}
function createMainWindow(): BrowserWindow {
const window = new BrowserWindow();
const window = new BrowserWindow({webPreferences: {nodeIntegration: true}});
if (isDevelopment)
window.webContents.openDevTools();
@ -31,21 +32,25 @@ function createMainWindow(): BrowserWindow {
window.webContents.on('devtools-opened', () => {
window.webContents.focus();
});
})
return window;
}
// quit application when all windows are closed
app.on('window-all-closed', () => {
// on macOS it is common for applications to stay open until the user explicitly quits
if (process.platform !== 'darwin')
app.quit();
});
app.on('activate', () => {
// on macOS it is common to re-create a window even after all windows have been closed
if (!mainWindow)
mainWindow = createMainWindow();
});
// create main BrowserWindow when electron is ready
app.on('ready', () => {
mainWindow = createMainWindow();
});

View file

@ -89,9 +89,7 @@ export class Renderer {
}
private mkContext(): WebGLRenderingContext {
const gl = (
this.canvas.getContext('webgl') || this.canvas.getContext('experimental-webgl')
);
const gl = this.canvas.getContext('webgl');
if (!gl)
throw new Error('unable to initialize WebGL context');