diff --git a/frontend/app/shared/components/comments/comment.component.ts b/frontend/app/shared/components/comments/comment.component.ts index f84ad2eca..4d6655511 100644 --- a/frontend/app/shared/components/comments/comment.component.ts +++ b/frontend/app/shared/components/comments/comment.component.ts @@ -72,7 +72,7 @@ export class CommentComponent implements OnChanges { } public delete() { - if (!this.isDeletable) { + if (!this.isDeletable && !this.canDelete) { return; } diff --git a/frontend/app/shared/state/comments.state.ts b/frontend/app/shared/state/comments.state.ts index 72a7a5cd2..24d6beabe 100644 --- a/frontend/app/shared/state/comments.state.ts +++ b/frontend/app/shared/state/comments.state.ts @@ -37,6 +37,7 @@ export class CommentsState extends State { private readonly commentsUrl: string, private readonly commentsService: CommentsService, private readonly dialogs: DialogService, + private readonly orderDescending = false, initialVersion = -1 ) { super({ comments: [], version: new Version(initialVersion.toString()) }); @@ -50,7 +51,11 @@ export class CommentsState extends State { for (const created of payload.createdComments) { if (!comments.find(x => x.id === created.id)) { - comments = [...comments, created]; + if (this.orderDescending) { + comments = [created, ...comments]; + } else { + comments = [...comments, created]; + } } } diff --git a/frontend/app/shell/pages/internal/notifications-menu.component.ts b/frontend/app/shell/pages/internal/notifications-menu.component.ts index 1879e6d66..0d4482fba 100644 --- a/frontend/app/shell/pages/internal/notifications-menu.component.ts +++ b/frontend/app/shell/pages/internal/notifications-menu.component.ts @@ -55,6 +55,7 @@ export class NotificationsMenuComponent extends ResourceOwner implements OnInit commentsUrl, commentsService, dialogs, + true, this.versionRead); }