From 949397847354aec83be5e2ed40b863d349ca0688 Mon Sep 17 00:00:00 2001 From: hackademix Date: Sat, 6 Apr 2019 10:49:57 +0200 Subject: Fixed resetting options works just once per session (defaults reference current settings) - issue #69. --- src/bg/Settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/bg/Settings.js b/src/bg/Settings.js index c0af149..28f880e 100644 --- a/src/bg/Settings.js +++ b/src/bg/Settings.js @@ -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"); -- cgit v1.2.3