Skip to content

Commit

Permalink
Sonar: Update this function so that its implementation is not identic…
Browse files Browse the repository at this point in the history
…al to the one on line 69
  • Loading branch information
qmonmert committed Sep 24, 2023
1 parent c094722 commit 605f9fb
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 605f9fb

Please sign in to comment.