From 537dc01fd1a455c7909f5c463dcfd94b27aa719e Mon Sep 17 00:00:00 2001 From: Goh Jia Hao Date: Thu, 26 May 2016 18:01:33 +0800 Subject: [PATCH] Fix linting errors --- app/src/components/mainWindow/mainWindow.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/components/mainWindow/mainWindow.js b/app/src/components/mainWindow/mainWindow.js index 7cc52ff..648a948 100644 --- a/app/src/components/mainWindow/mainWindow.js +++ b/app/src/components/mainWindow/mainWindow.js @@ -129,23 +129,23 @@ function createMainWindow(options, onAppQuit, setDockBadge) { mainWindow.webContents.setUserAgent(options.userAgent); } + const injectCss = () => { + mainWindow.webContents.insertCSS(getCssToInject()); + }; + mainWindow.webContents.on('did-finish-load', () => { mainWindow.webContents.send('params', JSON.stringify(options)); // remove the injection of css the moment the page is loaded mainWindow.webContents.removeListener('did-get-response-details', injectCss); }); - const injectCss = () => { - mainWindow.webContents.insertCSS(getCssToInject()); - } - // on every page navigation inject the css mainWindow.webContents.on('did-start-loading', () => { // we have to inject the css in did-get-response-details to prevent the fouc // will run multiple times mainWindow.webContents.on('did-get-response-details', injectCss); }); - + if (options.counter) { mainWindow.on('page-title-updated', () => { if (mainWindow.isFocused()) {