From 513677e94e23523a619c00247c8db3436ab214e9 Mon Sep 17 00:00:00 2001 From: mutugiii Date: Tue, 8 Oct 2024 20:50:35 +0300 Subject: [PATCH] Use challengeActive bool && check for config code not name --- src/app/community/community.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index 710d2edf66..16db15e92a 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -49,6 +49,7 @@ export class CommunityComponent implements OnInit, OnDestroy { resizeCalendar: any = false; deviceType: DeviceType; deviceTypes = DeviceType; + challengeActive: boolean; challengeTemplate = ` # Challenge Template @@ -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(); } } @@ -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' } ],