From 1394331133c7aedcd8de471422fdcd35b855b922 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 23 Jan 2020 16:33:33 -0700 Subject: [PATCH] Fix booleans --- .../views/settings/tabs/user/GeneralUserSettingsTab.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js index 1325a1c583..2d56df6be4 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js @@ -73,7 +73,11 @@ export default class GeneralUserSettingsTab extends React.Component { const capabilities = await cli.getCapabilities(); // this is cached 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});