Skip to content

Commit

Permalink
Merge pull request #8983 from vector-im/t3chguy/local-config
Browse files Browse the repository at this point in the history
Add support for localConfig at $appData/config.json.
  • Loading branch information
t3chguy committed Mar 1, 2019
2 parents 4f58dea + 0e0c1cf commit baa0342
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion electron_app/src/electron-main.js
Expand Up @@ -56,7 +56,15 @@ try {
// Continue with the defaults (ie. an empty config)
}

const store = new Store();
try {
// Load local config and use it to override values from the one baked with the build
const localConfig = require(path.join(app.getPath('userData'), 'config.json'));
vectorConfig = Object.assign(vectorConfig, localConfig);
} catch (e) {
// Could not load local config, this is expected in most cases.
}

const store = new Store({ name: "electron-config" });

let mainWindow = null;
global.appQuitting = false;
Expand Down

0 comments on commit baa0342

Please sign in to comment.