first cut (untested)
This commit is contained in:
@@ -113,6 +113,34 @@ module.exports = {
|
||||
});
|
||||
},
|
||||
|
||||
getUrlPreviewsDisabled: function() {
|
||||
var event = MatrixClientPeg.get().getAccountData("org.matrix.preview_urls");
|
||||
return (event && event.disable);
|
||||
},
|
||||
|
||||
setUrlPreviewsDisabled: function(disabled) {
|
||||
// FIXME: handle errors
|
||||
MatrixClientPeg.get().setAccountData("org.matrix.preview_urls", {
|
||||
disable: disabled
|
||||
});
|
||||
},
|
||||
|
||||
getSyncedSettings: function() {
|
||||
return MatrixClientPeg.get().getAccountData("im.vector.web.settings") || {};
|
||||
},
|
||||
|
||||
getSyncedSetting: function(type) {
|
||||
var settings = this.getSyncedSettings();
|
||||
return settings[type];
|
||||
},
|
||||
|
||||
setSyncedSetting: function(type, value) {
|
||||
var settings = this.getSyncedSettings();
|
||||
settings[type] = value;
|
||||
// FIXME: handle errors
|
||||
MatrixClientPeg.get().setAccountData("im.vector.web.settings", settings);
|
||||
},
|
||||
|
||||
isFeatureEnabled: function(feature: string): boolean {
|
||||
return localStorage.getItem(`mx_labs_feature_${feature}`) === 'true';
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user