move config.startTime to app.startTime

This also captures the true start time since it runs before any
require() calls, so the time to require() will be taken into account.
This commit is contained in:
Feross Aboukhadijeh
2016-03-04 16:10:14 -08:00
parent 5f02b73616
commit 82fc6cabe8
4 changed files with 16 additions and 9 deletions

View File

@@ -1,7 +1,8 @@
var electron = require('electron')
var debug = require('debug')('webtorrent-app:menu')
var windows = require('./windows')
var config = require('./config')
var app = electron.app
function toggleFullScreen () {
debug('toggleFullScreen')
@@ -34,7 +35,7 @@ function toggleDevTools () {
function reloadWindow () {
debug('reloadWindow')
if (windows.main) {
config.startTime = Date.now()
app.startTime = Date.now()
windows.main.webContents.reloadIgnoringCache()
}
}
@@ -191,7 +192,7 @@ function getMenuTemplate () {
]
if (process.platform === 'darwin') {
var name = electron.app.getName()
var name = app.getName()
template.unshift({
label: name,
submenu: [
@@ -230,7 +231,7 @@ function getMenuTemplate () {
{
label: 'Quit',
accelerator: 'Command+Q',
click: function () { electron.app.quit() }
click: function () { app.quit() }
}
]
})