Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix stray 'account' heading #12791

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/

import React, { ReactNode } from "react";

Check failure on line 19 in src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx

View workflow job for this annotation

GitHub Actions / ESLint

'ReactNode' is defined but never used

Check failure on line 19 in src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx

View workflow job for this annotation

GitHub Actions / Typescript Syntax Check

'ReactNode' is declared but its value is never read.
import { HTTPError } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";

Expand Down Expand Up @@ -146,22 +146,8 @@
});
};

private renderAccountSection(): JSX.Element {
let passwordChangeSection: ReactNode = null;
if (this.state.canChangePassword) {
passwordChangeSection = (
<>
<SettingsSubsectionText>{_t("settings|general|password_change_section")}</SettingsSubsectionText>
<ChangePassword
className="mx_GeneralUserSettingsTab_section--account_changePassword"
rowClassName=""
buttonKind="primary"
onError={this.onPasswordChangeError}
onFinished={this.onPasswordChanged}
/>
</>
);
}
private renderAccountSection(): JSX.Element | undefined {
if (!this.state.canChangePassword) return undefined;

return (
<>
Expand All @@ -170,7 +156,14 @@
stretchContent
data-testid="accountSection"
>
{passwordChangeSection}
<SettingsSubsectionText>{_t("settings|general|password_change_section")}</SettingsSubsectionText>
<ChangePassword
className="mx_GeneralUserSettingsTab_section--account_changePassword"
rowClassName=""
buttonKind="primary"
onError={this.onPasswordChangeError}
onFinished={this.onPasswordChanged}
/>
</SettingsSubsection>
</>
);
Expand Down
Loading