no labs for guests

This commit is contained in:
Matthew Hodgson 2016-09-17 14:29:40 +01:00
parent 0046ae50b5
commit cf1b1442eb
2 changed files with 13 additions and 0 deletions

View file

@ -369,6 +369,16 @@ module.exports = React.createClass({
name={feature.id}
defaultChecked={ UserSettingsStore.isFeatureEnabled(feature.id) }
onChange={e => {
if (MatrixClientPeg.get().isGuest()) {
e.target.checked = false;
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
Modal.createDialog(NeedToRegisterDialog, {
title: "Please Register",
description: "Guests can't use labs features. Please register.",
});
return;
}
UserSettingsStore.setFeatureEnabled(feature.id, e.target.checked);
this.forceUpdate();
}}/>