From 564ea53b8395595706ea8c9d6cca62e32145c108 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 18 Jul 2024 14:04:40 +0100 Subject: [PATCH] Fix stray 'account' heading (#12791) * Fix stray 'account' heading There's nothing in the 'account' section other than the password change control now, so remove the whole section if you can't change your password. Fixes https://github.com/element-hq/element-web/issues/27756 * Unused import --- .../tabs/user/GeneralUserSettingsTab.tsx | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) 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")} + );