Skip to content

Commit 0522dcf

Browse files
Updated code for environment
1 parent 32278f7 commit 0522dcf

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

electron/main.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const MIGRATION_FILE = path.join(HOME, "migration.json");
2121
const USER_DATA_FILE = path.join(HOME, "config.json");
2222
const REACT_APP_LOCATION = `file://${path.join(__dirname, '../build/index.html')}`
2323
const DEFAULT_FILE_SERVER_PORT = "8080";
24-
const ENV = "dev";
24+
const ENV = process.env.RUNTIME_ENV || "prod";
2525

2626
console.log("HOME: " + HOME);
2727
console.log("CONFIG FILE: " + CONFIG_FILE);
@@ -59,13 +59,11 @@ if (!fs.existsSync(CONFIG_FILE)) {
5959
"redemptions": {},
6060
"gauges": {},
6161
"commands": {},
62-
"clientId": "",
63-
"clientSecret": "",
6462
"twitchChannel": "",
6563
"broadcasterId": "",
6664
"profileImage": "",
6765
"accessToken": "",
68-
"refreshToken": ""
66+
"refreshToken": "",
6967
}));
7068
}
7169

@@ -117,7 +115,7 @@ const createWindow = async () => {
117115
},
118116
});
119117
// and load the index.html of the app.
120-
if(ENV === "dev"){
118+
if (ENV === "dev"){
121119
//for dev
122120
win.loadURL('http://localhost:3000/');
123121
} else if (ENV === "prod" || ENV === "production"){

0 commit comments

Comments
 (0)