Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
insomnious committed Nov 12, 2024
2 parents 7df958a + 8c8b778 commit c144b33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/extensions/mod_management/util/modGrouping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function newestFirst(lhs: IModWithState, rhs: IModWithState): number {
*/
function byEnabled(input: IModWithState[]): IModWithState[][] {
// put each enabled mod into its own group. Ideally there should only be one
const groups: IModWithState[][] = input.filter((mod => mod.enabled)).map(mod => [mod]);
const groups: IModWithState[][] = input.filter((mod => mod?.enabled === true)).map(mod => [mod]);
// it is of course possible that no mod in input is enabled.
if (groups.length === 0) {
return [ input ];
Expand Down
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
1 change: 1 addition & 0 deletions src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ export function replaceRecursive(input: any, from: any, to: any) {
}

function removeLeadingZeros(input: string): string {
if (!input) { return input; }
return input.split('.').map(seg => seg.replace(/^0+(\d+$)/, '$1')).join('.');
}

Expand Down

0 comments on commit c144b33

Please sign in to comment.