signal-desktop/app/user_config.js
Scott Nonnenberg 998c35dcb3 Split configuration into low and high traffic files
Also, we're now handling config ourselves instead of using
electron-config and config dependencies.
2018-08-29 10:40:16 -07:00

25 lines
618 B
JavaScript

const path = require('path');
const { app } = require('electron');
const { start } = require('./base_config');
const config = require('./config');
// Use separate data directory for development
if (config.has('storageProfile')) {
const userData = path.join(
app.getPath('appData'),
`Signal-${config.get('storageProfile')}`
);
app.setPath('userData', userData);
}
console.log(`userData: ${app.getPath('userData')}`);
const userDataPath = app.getPath('userData');
const targetPath = path.join(userDataPath, 'config.json');
const userConfig = start('user', targetPath);
module.exports = userConfig;