Convert synced settings to granular settings
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
bf815f4be9
commit
ae10a11ac4
21 changed files with 177 additions and 161 deletions
|
@ -137,23 +137,6 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
getSyncedSettings: function() {
|
||||
const event = MatrixClientPeg.get().getAccountData('im.vector.web.settings');
|
||||
return event ? event.getContent() : {};
|
||||
},
|
||||
|
||||
getSyncedSetting: function(type, defaultValue = null) {
|
||||
const settings = this.getSyncedSettings();
|
||||
return settings.hasOwnProperty(type) ? settings[type] : defaultValue;
|
||||
},
|
||||
|
||||
setSyncedSetting: function(type, value) {
|
||||
const settings = this.getSyncedSettings();
|
||||
settings[type] = value;
|
||||
// FIXME: handle errors
|
||||
return MatrixClientPeg.get().setAccountData('im.vector.web.settings', settings);
|
||||
},
|
||||
|
||||
getLocalSettings: function() {
|
||||
const localSettingsString = localStorage.getItem('mx_local_settings') || '{}';
|
||||
return JSON.parse(localSettingsString);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue