Fixed line endings.

This commit is contained in:
hackademix 2018-09-15 22:10:19 +02:00
parent 297fec781f
commit e4e1c83f2c
1 changed files with 38 additions and 38 deletions

View File

@ -1,38 +1,38 @@
'use strict'; 'use strict';
var Defaults = { var Defaults = {
async init() { async init() {
let defaults = { let defaults = {
local: { local: {
debug: false, debug: false,
showCtxMenuItem: true, showCtxMenuItem: true,
showCountBadge: true, showCountBadge: true,
showFullAddresses: false, showFullAddresses: false,
}, },
sync: { sync: {
"global": false, "global": false,
"xss": true, "xss": true,
"clearclick": true "clearclick": true
} }
}; };
let defaultsClone = JSON.parse(JSON.stringify(defaults)); let defaultsClone = JSON.parse(JSON.stringify(defaults));
for (let [k, v] of Object.entries(defaults)) { for (let [k, v] of Object.entries(defaults)) {
let store = await Storage.get(k, k); let store = await Storage.get(k, k);
if (k in store) { if (k in store) {
Object.assign(v, store[k]); Object.assign(v, store[k]);
} }
v.storage = k; v.storage = k;
} }
Object.assign(ns, defaults); Object.assign(ns, defaults);
// dynamic settings // dynamic settings
if (!ns.local.uuid) { if (!ns.local.uuid) {
ns.local.uuid = uuid(); ns.local.uuid = uuid();
await ns.save(ns.local); await ns.save(ns.local);
} }
return ns.defaults = defaultsClone; return ns.defaults = defaultsClone;
} }
}; };