Fix booleans
This commit is contained in:
parent
c22bfa84b7
commit
1394331133
1 changed files with 5 additions and 1 deletions
|
@ -73,7 +73,11 @@ export default class GeneralUserSettingsTab extends React.Component {
|
||||||
|
|
||||||
const capabilities = await cli.getCapabilities(); // this is cached
|
const capabilities = await cli.getCapabilities(); // this is cached
|
||||||
const changePasswordCap = capabilities['m.change_password'];
|
const changePasswordCap = capabilities['m.change_password'];
|
||||||
const canChangePassword = changePasswordCap && changePasswordCap['enabled'] === false;
|
|
||||||
|
// You can change your password so long as the capability isn't explicitly disabled. The implicit
|
||||||
|
// behaviour is you can change your password when the capability is missing or has not-false as
|
||||||
|
// the enabled flag value.
|
||||||
|
const canChangePassword = !changePasswordCap || changePasswordCap['enabled'] !== false;
|
||||||
|
|
||||||
this.setState({serverSupportsSeparateAddAndBind, canChangePassword});
|
this.setState({serverSupportsSeparateAddAndBind, canChangePassword});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue