1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-05 23:10:41 +03:00

UI for blacklisting unverified devices per-room & globally

(written blind; untested as yet)
This commit is contained in:
Matthew Hodgson
2017-01-21 17:39:31 +00:00
parent 2e15e8f9b4
commit 3071fc0ddc
4 changed files with 94 additions and 3 deletions

View File

@@ -149,6 +149,22 @@ module.exports = {
return MatrixClientPeg.get().setAccountData("im.vector.web.settings", settings);
},
getLocalSettings: function() {
return localStorage.getItem('mx_local_settings');
},
getLocalSetting: function(type, defaultValue = null) {
var settings = this.getLocalSettings();
return settings.hasOwnProperty(type) ? settings[type] : null;
},
setLocalSetting: function(type, value) {
var settings = this.getLocalSettings();
settings[type] = value;
// FIXME: handle errors
localStorage.setItem('mx_local_settings', settings);
},
isFeatureEnabled: function(feature: string): boolean {
// Disable labs for guests.
if (MatrixClientPeg.get().isGuest()) return false;