no labs for guests
This commit is contained in:
parent
0046ae50b5
commit
cf1b1442eb
2 changed files with 13 additions and 0 deletions
|
@ -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();
|
||||
}}/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue