Convert local settings to granular settings
This breaks language selection. Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
b3d17a7b51
commit
0d3f0eaf98
11 changed files with 83 additions and 77 deletions
|
@ -136,21 +136,4 @@ export default {
|
|||
disable: disabled,
|
||||
});
|
||||
},
|
||||
|
||||
getLocalSettings: function() {
|
||||
const localSettingsString = localStorage.getItem('mx_local_settings') || '{}';
|
||||
return JSON.parse(localSettingsString);
|
||||
},
|
||||
|
||||
getLocalSetting: function(type, defaultValue = null) {
|
||||
const settings = this.getLocalSettings();
|
||||
return settings.hasOwnProperty(type) ? settings[type] : defaultValue;
|
||||
},
|
||||
|
||||
setLocalSetting: function(type, value) {
|
||||
const settings = this.getLocalSettings();
|
||||
settings[type] = value;
|
||||
// FIXME: handle errors
|
||||
localStorage.setItem('mx_local_settings', JSON.stringify(settings));
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue