Skip to content

Commit

Permalink
Merge pull request #426 from jhipster/codesmells
Browse files Browse the repository at this point in the history
Sonar: Update this function so that its implementation is not identical to the one on line 69
  • Loading branch information
DanielFran authored Sep 24, 2023
2 parents c094722 + 605f9fb commit 35cf219
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/webapp/app/home/jdl-metadata/jdl-studio.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ export class DeleteJdlStudioComponent implements OnInit, OnDestroy {
}

ngOnDestroy(): void {
if (this.subscription) {
this.subscription.unsubscribe();
}
unsubscribe(this.subscription);
}
}

Expand Down Expand Up @@ -164,12 +162,16 @@ export class ApplyJdlStudioComponent implements OnInit, OnDestroy {
}

ngOnDestroy(): void {
if (this.subscription) {
this.subscription.unsubscribe();
}
unsubscribe(this.subscription);
}

isAtLeastOneGitProviderAvailableAndConfigured(): boolean {
return (this.gitConfig.githubAvailable && this.githubConfigured) || (this.gitConfig.gitlabAvailable && this.gitlabConfigured) || false;
}
}

const unsubscribe = (subscription: Subscription | undefined) => {
if (subscription) {
subscription.unsubscribe();
}
};

0 comments on commit 35cf219

Please sign in to comment.