Skip to content

Commit

Permalink
Use challengeActive bool && check for config code not name
Browse files Browse the repository at this point in the history
  • Loading branch information
Mutugiii committed Oct 8, 2024
1 parent 38a35fb commit 513677e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/community/community.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
resizeCalendar: any = false;
deviceType: DeviceType;
deviceTypes = DeviceType;
challengeActive: boolean;
challengeTemplate = `
# Challenge Template
Expand Down Expand Up @@ -95,7 +96,8 @@ export class CommunityComponent implements OnInit, OnDestroy {
this.setCouncillors(users);
}
});
if (this.configuration.name === 'learning' && new Date().getMonth() === 9) {
this.challengeActive = this.configuration.code === 'learning' && new Date().getMonth() === 9;
if (this.challengeActive) {
this.openAnnouncementDialog();
}
}
Expand Down Expand Up @@ -158,7 +160,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
this.dialog.open(DialogsAnnouncementComponent);
}

openAddMessageDialog(message = this.configuration.name === 'learning' ? this.challengeTemplate : '') {
openAddMessageDialog(message = this.challengeActive ? this.challengeTemplate : '') {
this.dialogsFormService.openDialogsForm(
$localize`Add Voice`,
[ { name: 'message', placeholder: $localize`Your Voice`, type: 'markdown', required: true, imageGroup: 'community' } ],
Expand Down

0 comments on commit 513677e

Please sign in to comment.