fix notification

This commit is contained in:
Peter Maquiran
2024-06-28 07:44:43 +01:00
parent ac0ead4885
commit 0281db0d83
18 changed files with 243 additions and 218 deletions
+7 -6
View File
@@ -75,9 +75,9 @@
<div class="profile-text">
<div *ngIf="NotificationHolderService.notificationList.length > 0" class="icon-badge" style="right: -6px;top: 38px;top: -6px;">
{{NotificationHolderService.notificationList.length}} </div>
<div class="profile-text" *ngIf="(notificationCount$ | async) as notificationCount ">
<div *ngIf="notificationCount > 0" class="icon-badge" style="right: -6px;top: 38px;top: -6px;">
{{notificationCount}} </div>
</div>
</div>
</div>
@@ -243,9 +243,10 @@
<img class="profile-image font-45-em image-prety" src={{profilePicture}}>
</div>
<div class="profile-text">
<div *ngIf="NotificationHolderService.notificationList.length > 0" class="icon-badge" style="right: -6px;top: 38px;top: -6px;">
{{NotificationHolderService.notificationList.length}} </div>
<div class="profile-text" *ngIf="(notificationCount$ | async) as notificationCount ">
<div *ngIf="notificationCount > 0" class="icon-badge" style="right: -6px;top: 38px;top: -6px;">
{{notificationCount}} </div>
</div>
</div>
+13 -1
View File
@@ -19,6 +19,8 @@ import { NotificationHolderService } from 'src/app/store/notification-holder.ser
import { HeaderSettingsService } from "src/app/services/header-settings.service"
import { PublicationHolderService } from 'src/app/services/publication/publication-holder.service'
import { Cy } from 'cypress/enum'
import { NotificationRepositoryService } from 'src/app/module/notification/data/notification-repository.service';
import { Observable } from 'rxjs';
@Component({
selector: 'app-header',
templateUrl: './header.page.html',
@@ -56,6 +58,8 @@ export class HeaderPage implements OnInit {
Cy = Cy
notificationCount$: Observable<number>
constructor(
private router: Router,
private modalController: ModalController,
@@ -74,8 +78,16 @@ export class HeaderPage implements OnInit {
private attachmentService: AttachmentsService,
public NotificationHolderService: NotificationHolderService,
public HeaderSettingsService: HeaderSettingsService,
public PublicationHolderService: PublicationHolderService
public PublicationHolderService: PublicationHolderService,
private notificationRepositoryService: NotificationRepositoryService
) {
this.notificationCount$ = this.notificationRepositoryService.getNotificationLiveCount()
this.notificationCount$.subscribe(count => {
console.log('Notification Count:', count);
});
this.loggeduser = SessionStore.user;
router.events.subscribe((val) => {
this.hideSearch();