-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
config.js
42 lines (34 loc) · 1.01 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var Config = require('electron-config');
var instance;
function AppConfig() {
var config = new Config();
var defaults = {
showDockIcon : true,
alwaysOnTop : true,
showOnRightClick : false,
preloadWindow : true,
width : 400,
height : 400,
windowPosition : 'trayCenter',
externalLinks : false,
userAgent : 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1',
globalShortcuts : true
};
if (typeof config.store === 'object') {
if (Object.keys(config.store).length === 0) {
config.set(defaults);
}
}
this.store = Object.assign(defaults, config.store) || {};
this.config = config;
}
AppConfig.prototype = {
update : function (config) {
this.config.set(config);
}
};
var getInstance = function () {
instance = instance || new AppConfig();
return instance;
};
module.exports = getInstance();