Merge pull request #8983 from vector-im/t3chguy/local-config

Add support for localConfig at $appData/config.json.
pull/9047/head
Michael Telatynski 2019-03-01 07:54:49 +00:00 committed by GitHub
commit baa034230f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -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;