Fix lint warnings

This commit is contained in:
Cheng Zhao 2016-04-13 23:10:31 +09:00
parent 43c44da50b
commit 8f0e594007
2 changed files with 5 additions and 4 deletions

View file

@ -82,7 +82,7 @@ BrowserWindow.prototype._init = function () {
let isVisible = this.isVisible() && !this.isMinimized()
let visibilityChanged = () => {
let newState = this.isVisible() && !this.isMinimized()
if (isVisible != newState) {
if (isVisible !== newState) {
isVisible = newState
this.webContents.send('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', isVisible ? 'visible' : 'hidden')
}
@ -94,8 +94,9 @@ BrowserWindow.prototype._init = function () {
this.on('maximize', visibilityChanged)
// Make renderer process have correct initial state.
if (!isVisible)
if (!isVisible) {
this.webContents.mergeWebPreferences({visibilityState: 'hidden'})
}
// Notify the creation of the window.
app.emit('browser-window-created', {}, this)

View file

@ -232,7 +232,7 @@ if (process.visibilityState) {
// Subscribe to visibilityState changes.
ipcRenderer.on('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', function (event, visibilityState) {
if (cachedVisibilityState != visibilityState) {
if (cachedVisibilityState !== visibilityState) {
cachedVisibilityState = visibilityState
document.dispatchEvent(new Event('visibilitychange'))
}
@ -241,7 +241,7 @@ ipcRenderer.on('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', function (event, vi
// Make document.hidden and document.visibilityState return the correct value.
Object.defineProperty(document, 'hidden', {
get: function () {
return cachedVisibilityState != 'visible'
return cachedVisibilityState !== 'visible'
}
})