Skip to content

Commit

Permalink
Merge pull request #16602 from Nexus-Mods/16600-login-lexical-bind
Browse files Browse the repository at this point in the history
fixed potentially unbound login component class member functions
  • Loading branch information
insomnious authored Nov 12, 2024
2 parents 6dee7a3 + 886f726 commit 0f2fc0e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/extensions/nexus_integration/views/LoginIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,24 @@ class LoginIcon extends ComponentEx<IProps, {}> {
return 'Free';
}

private renderMembershipStatus() {
private renderMembershipStatus = () => {
const { t, userInfo } = this.props;

const membership = this.getMembershipText(userInfo);
const classes = `membership-status ${membership.toLocaleLowerCase()}`

if (this.isLoggedIn()) {
return (
<div id='membership-status' className={classes}>
<div className='membership-status-text'>{membership}</div>
</div>
<div id='membership-status' className={classes}>
<div className='membership-status-text'>{membership}</div>
</div>
);
} else {
return null;
}
}

private renderLoginName() {
private renderLoginName = () => {
const { t, userInfo } = this.props;

if (this.isLoggedIn()) {
Expand All @@ -123,7 +123,7 @@ class LoginIcon extends ComponentEx<IProps, {}> {
}
}

private renderAvatar() {
private renderAvatar = () => {
const { t, userInfo } = this.props;

const loggedIn = this.isLoggedIn();
Expand Down Expand Up @@ -176,7 +176,7 @@ class LoginIcon extends ComponentEx<IProps, {}> {
});
}

private isLoggedIn() {
private isLoggedIn = () => {
const { isLoggedIn, userInfo } = this.props;
//return isLoggedIn;
return isLoggedIn && (userInfo !== undefined) && (userInfo !== null);
Expand All @@ -186,7 +186,7 @@ class LoginIcon extends ComponentEx<IProps, {}> {
this.setDialogVisible(false);
}

private setDialogVisible(visible: boolean): void {
private setDialogVisible = (visible: boolean): void => {
this.props.onShowDialog();
}
}
Expand Down

0 comments on commit 0f2fc0e

Please sign in to comment.