|
1 | 1 | //Note: This file is provided as an aid to help you get up and running with
|
2 | 2 | //Electron for desktop apps. See the readme file for more information.
|
| 3 | +/* eslint-disable strict, no-var, no-console */ |
3 | 4 |
|
4 | 5 | 'use strict';
|
5 | 6 |
|
6 |
| -var app = require('app'); |
7 |
| -var BrowserWindow = require('browser-window'); |
| 7 | +const electron = require('electron'); |
| 8 | +const {app} = electron; |
| 9 | +const {BrowserWindow} = electron; |
| 10 | +let mainWindow; |
8 | 11 |
|
9 |
| -require('crash-reporter').start(); |
10 |
| - |
11 |
| -var mainWindow = null; |
12 |
| - |
13 |
| -app.on('window-all-closed', function () { |
14 |
| - if (process.platform != 'darwin') { |
15 |
| - app.quit(); |
16 |
| - } |
| 12 | +app.on('window-all-closed', () => { |
| 13 | + if (process.platform !== 'darwin') { |
| 14 | + app.quit(); |
| 15 | + } |
17 | 16 | });
|
18 | 17 |
|
19 |
| -app.on('ready', function () { |
20 |
| - mainWindow = new BrowserWindow({ |
21 |
| - width: 800, |
22 |
| - height: 600 |
23 |
| - }); |
| 18 | +app.on('ready', () => { |
| 19 | + mainWindow = new BrowserWindow({ |
| 20 | + width: 800, |
| 21 | + height: 600 |
| 22 | + }); |
24 | 23 |
|
25 |
| - mainWindow.loadUrl('file://' + __dirname + '/index.html'); |
26 |
| - mainWindow.webContents.on('did-finish-load', function () { |
27 |
| - mainWindow.setTitle(app.getName()); |
28 |
| - }); |
29 |
| - mainWindow.on('closed', function () { |
30 |
| - mainWindow = null; |
31 |
| - }); |
| 24 | + mainWindow.loadURL(`file://${__dirname}/index.html`); |
| 25 | + mainWindow.webContents.on('did-finish-load', () => { |
| 26 | + mainWindow.setTitle(app.getName()); |
| 27 | + }); |
| 28 | + |
| 29 | + mainWindow.on('closed', () => { |
| 30 | + mainWindow = null; |
| 31 | + }); |
32 | 32 | });
|
0 commit comments