diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx index 57d1983238..8405dd83ba 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { ReactNode } from "react"; +import React from "react"; import { HTTPError } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; @@ -146,22 +146,8 @@ export default class GeneralUserSettingsTab extends React.Component - {_t("settings|general|password_change_section")} - - - ); - } + private renderAccountSection(): JSX.Element | undefined { + if (!this.state.canChangePassword) return undefined; return ( <> @@ -170,7 +156,14 @@ export default class GeneralUserSettingsTab extends React.Component - {passwordChangeSection} + {_t("settings|general|password_change_section")} + );