Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

Commit

Permalink
node env change
Browse files Browse the repository at this point in the history
  • Loading branch information
luis rojas committed Mar 19, 2018
1 parent 5db10cb commit 6440318
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,16 @@ const getPostData = require('./components/main/user-post');
const Loop = require('./components/main/loop');
const Throttle = require("./components/main/throttle");

if (process.env.NODE_ENV !== "production")
if (process.env.NODE_ENV === "development")
require('electron-reload')(__dirname);


// prevent window being garbage collected
let mainWindow;
let helpWindow;
let loop;

function onClosed() {
mainWindow = null;
loop = null;
helpWindow = null;
}

function onSettingsClosed() {
helpWindow = null;
}

function createMainWindow() {
Expand Down Expand Up @@ -55,11 +48,10 @@ function createMainWindow() {
win.on('closed', onClosed);
let webContents = win.webContents;

webContents.on("dom-ready", () => {
webContents.once("dom-ready", () => {
webContents.send("asynchronous-reply", "THROTTLE_START", loop.getThrottle());
});


loop = new Loop().on('post', pData => {

getPostData(pData, (err, data) => {
Expand Down Expand Up @@ -193,6 +185,6 @@ app.on('activate', () => {

app.on('ready', () => {
mainWindow = createMainWindow();
if (process.env.NODE_ENV !== "production")
if (process.env.NODE_ENV === "development")
mainWindow.webContents.openDevTools();
});

0 comments on commit 6440318

Please sign in to comment.