client/settings: fix updating settings
Updating settings in browsing settings view has been reseting safety settings in post list.
This commit is contained in:
parent
3149c43b7e
commit
ad87506044
1 changed files with 2 additions and 2 deletions
|
@ -19,6 +19,7 @@ const defaultSettings = {
|
|||
|
||||
class Settings extends events.EventTarget {
|
||||
save(newSettings, silent) {
|
||||
newSettings = Object.assign(this.get(), newSettings);
|
||||
localStorage.setItem('settings', JSON.stringify(newSettings));
|
||||
if (silent !== true) {
|
||||
this.dispatchEvent(new CustomEvent('change', {
|
||||
|
@ -30,8 +31,7 @@ class Settings extends events.EventTarget {
|
|||
}
|
||||
|
||||
get() {
|
||||
let ret = {};
|
||||
Object.assign(ret, defaultSettings);
|
||||
let ret = Object.assign({}, defaultSettings);
|
||||
try {
|
||||
Object.assign(ret, JSON.parse(localStorage.getItem('settings')));
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in a new issue