Skip to content

Commit 6a9836a

Browse files
committed
Fix indentation
1 parent f18ac77 commit 6a9836a

File tree

1 file changed

+40
-37
lines changed

1 file changed

+40
-37
lines changed

main.js

+40-37
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use strict';
2+
23
const electron = require('electron');
34
// Module to control application life.
4-
const {app} = electron;
5+
const { app } = electron;
56
// Module to create native browser window.
6-
const {BrowserWindow} = electron;
7+
const { BrowserWindow } = electron;
78

89
let win, serve;
910
const args = process.argv.slice(1);
@@ -15,56 +16,58 @@ if (serve) {
1516

1617
function createWindow() {
1718

18-
let electronScreen = electron.screen;
19-
let size = electronScreen.getPrimaryDisplay().workAreaSize;
19+
let electronScreen = electron.screen;
20+
let size = electronScreen.getPrimaryDisplay().workAreaSize;
2021

21-
// Create the browser window.
22-
win = new BrowserWindow({
23-
x: 0,
24-
y: 0,
25-
width: size.width,
26-
height: size.height
27-
});
22+
// Create the browser window.
23+
win = new BrowserWindow({
24+
x: 0,
25+
y: 0,
26+
width: size.width,
27+
height: size.height
28+
});
2829

29-
let url = serve ?
30-
'file://' + __dirname + '/dist/index.html':
31-
'file://' + __dirname + '/index.html';
30+
let url = serve ?
31+
'file://' + __dirname + '/dist/index.html' :
32+
'file://' + __dirname + '/index.html';
3233

33-
// and load the index.html of the app.
34-
win.loadURL(url);
34+
// and load the index.html of the app.
35+
win.loadURL(url);
3536

36-
// Open the DevTools.
37-
if (serve) {
38-
win.webContents.openDevTools();
39-
}
37+
// Open the DevTools.
38+
if (serve) {
39+
win.webContents.openDevTools();
40+
}
4041

41-
// Emitted when the window is closed.
42-
win.on('closed', () => {
43-
// Dereference the window object, usually you would store windows
44-
// in an array if your app supports multi windows, this is the time
45-
// when you should delete the corresponding element.
46-
win = null;
47-
});
42+
// Emitted when the window is closed.
43+
win.on('closed', () => {
44+
// Dereference the window object, usually you would store window
45+
// in an array if your app supports multi windows, this is the time
46+
// when you should delete the corresponding element.
47+
win = null;
48+
});
4849
}
4950

51+
5052
// This method will be called when Electron has finished
5153
// initialization and is ready to create browser windows.
5254
// Some APIs can only be used after this event occurs.
5355
app.on('ready', createWindow);
5456

5557
// Quit when all windows are closed.
5658
app.on('window-all-closed', () => {
57-
// On OS X it is common for applications and their menu bar
58-
// to stay active until the user quits explicitly with Cmd + Q
59-
if (process.platform !== 'darwin') {
60-
app.quit();
61-
}
59+
// On OS X it is common for applications and their menu bar
60+
// to stay active until the user quits explicitly with Cmd + Q
61+
if (process.platform !== 'darwin') {
62+
app.quit();
63+
}
6264
});
6365

6466
app.on('activate', () => {
65-
// On OS X it's common to re-create a window in the app when the
66-
// dock icon is clicked and there are no other windows open.
67-
if (win === null) {
68-
createWindow();
69-
}
67+
// On OS X it's common to re-create a window in the app when the
68+
// dock icon is clicked and there are no other windows open.
69+
if (win === null) {
70+
createWindow();
71+
}
7072
});
73+

0 commit comments

Comments
 (0)