Fixed resetting options works just once per session (defaults reference current settings) - issue #69.

This commit is contained in:
hackademix 2019-04-06 10:49:57 +02:00
parent db85a7cb01
commit 9493978473
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ var Settings = {
async storage => (settings[storage] || // changed or...
settings[storage] === null // ... needs reset to default
) && await ns.save(settings[storage]
? Object.assign(ns[storage], settings[storage]) : ns[storage] = ns.defaults[storage])
? Object.assign(ns[storage], settings[storage]) : ns[storage] = Object.assign({}, ns.defaults[storage]))
));
if (ns.local.debug !== oldDebug) {
await include("/lib/log.js");