Browse Source

UI: Prevent action on preview and edit mode

pull/11233/head
Artem Dzhereleiko 2 years ago
parent
commit
1aa53c3a15
  1. 24
      ui-ngx/src/app/modules/home/components/widget/lib/cards/unread-notification-widget.component.ts

24
ui-ngx/src/app/modules/home/components/widget/lib/cards/unread-notification-widget.component.ts

@ -203,23 +203,29 @@ export class UnreadNotificationWidgetComponent implements OnInit, OnDestroy {
} }
markAsRead(id: string) { markAsRead(id: string) {
const cmd = NotificationSubscriber.createMarkAsReadCommand(this.notificationWsService, [id]); if (!this.ctx.isEdit && !this.ctx.isPreview) {
cmd.subscribe(); const cmd = NotificationSubscriber.createMarkAsReadCommand(this.notificationWsService, [id]);
cmd.subscribe();
}
} }
markAsAllRead($event: Event) { markAsAllRead($event: Event) {
if ($event) { if (!this.ctx.isEdit && !this.ctx.isPreview) {
$event.stopPropagation(); if ($event) {
$event.stopPropagation();
}
const cmd = NotificationSubscriber.createMarkAllAsReadCommand(this.notificationWsService);
cmd.subscribe();
} }
const cmd = NotificationSubscriber.createMarkAllAsReadCommand(this.notificationWsService);
cmd.subscribe();
} }
viewAll($event: Event) { viewAll($event: Event) {
if ($event) { if (!this.ctx.isEdit && !this.ctx.isPreview) {
$event.stopPropagation(); if ($event) {
$event.stopPropagation();
}
this.router.navigateByUrl(this.router.parseUrl('/notification/inbox')).then(() => {});
} }
this.router.navigateByUrl(this.router.parseUrl('/notification/inbox')).then(() => {});
} }
trackById(index: number, item: NotificationRequest): string { trackById(index: number, item: NotificationRequest): string {

Loading…
Cancel
Save