Update main.js
This commit is contained in:
		
							parent
							
								
									1a2e376b23
								
							
						
					
					
						commit
						89521a4166
					
				
							
								
								
									
										10
									
								
								main.js
								
								
								
								
							
							
						
						
									
										10
									
								
								main.js
								
								
								
								
							| 
						 | 
					@ -1,12 +1,14 @@
 | 
				
			||||||
var app = require('app');  // Module to control application life.
 | 
					'use strict';
 | 
				
			||||||
var BrowserWindow = require('browser-window');  // Module to create native browser window.
 | 
					const electron = require('electron');
 | 
				
			||||||
 | 
					const app = electron.app;  // Module to control application life.
 | 
				
			||||||
 | 
					const BrowserWindow = electron.BrowserWindow;  // Module to create native browser window.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Report crashes to our server.
 | 
					// Report crashes to our server.
 | 
				
			||||||
require('crash-reporter').start();
 | 
					require('crash-reporter').start();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Keep a global reference of the window object, if you don't, the window will
 | 
					// Keep a global reference of the window object, if you don't, the window will
 | 
				
			||||||
// be closed automatically when the JavaScript object is garbage collected.
 | 
					// be closed automatically when the JavaScript object is garbage collected.
 | 
				
			||||||
var mainWindow = null;
 | 
					let mainWindow;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Quit when all windows are closed.
 | 
					// Quit when all windows are closed.
 | 
				
			||||||
app.on('window-all-closed', function() {
 | 
					app.on('window-all-closed', function() {
 | 
				
			||||||
| 
						 | 
					@ -24,7 +26,7 @@ app.on('ready', function() {
 | 
				
			||||||
  mainWindow = new BrowserWindow({width: 800, height: 600});
 | 
					  mainWindow = new BrowserWindow({width: 800, height: 600});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // and load the index.html of the app.
 | 
					  // and load the index.html of the app.
 | 
				
			||||||
  mainWindow.loadUrl('file://' + __dirname + '/index.html');
 | 
					  mainWindow.loadUrl(`file://${__dirname}/index.html`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Open the DevTools.
 | 
					  // Open the DevTools.
 | 
				
			||||||
  mainWindow.webContents.openDevTools();
 | 
					  mainWindow.webContents.openDevTools();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue