Skip to content
This repository has been archived by the owner on Dec 14, 2024. It is now read-only.

Commit

Permalink
move logic for setting cert
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Jan 22, 2024
1 parent a2bb385 commit adaa84d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if (require('electron-squirrel-startup')) app.quit();
app.commandLine.appendSwitch("force_high_performance_gpu");
app.commandLine.appendSwitch("enable-features", "SharedArrayBuffer");

getAppConfig();

/* Remove the comment (//) from the line below to ignore certificate errors (useful for self-signed certificates) */

//app.commandLine.appendSwitch("ignore-certificate-errors");
Expand Down Expand Up @@ -229,11 +231,11 @@ function getAppConfig(): AppConfig {
try {
const json = fs.readFileSync(path.join(app.getAppPath(), "config.json")).toString();
let appConfig = JSON.parse(json) as AppConfig;
const userData = getUserData();
appConfig = {...appConfig, ...userData.app};
if (appConfig.ignoreCertificateErrors) {
app.commandLine.appendSwitch("ignore-certificate-errors");
}
const userData = getUserData();
appConfig = {...appConfig, ...userData.app};
return appConfig;
} catch (e) {
return {} as AppConfig;
Expand Down

0 comments on commit adaa84d

Please sign in to comment.