From 7d2aabe7898e467bacf1e31998a3df59b3105f59 Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Wed, 28 Aug 2024 15:18:54 +0200 Subject: [PATCH] Handle chat messages with `meeting_user_id` set to `null` --- .../chat-group-detail-message.component.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/app/site/pages/meetings/pages/chat/pages/chat-group-list/components/chat-group-detail-message/chat-group-detail-message.component.ts b/client/src/app/site/pages/meetings/pages/chat/pages/chat-group-list/components/chat-group-detail-message/chat-group-detail-message.component.ts index df4b740890..3ac81266ed 100644 --- a/client/src/app/site/pages/meetings/pages/chat/pages/chat-group-list/components/chat-group-detail-message/chat-group-detail-message.component.ts +++ b/client/src/app/site/pages/meetings/pages/chat/pages/chat-group-list/components/chat-group-detail-message/chat-group-detail-message.component.ts @@ -1,4 +1,5 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; import { Permission } from 'src/app/domain/definitions/permission'; import { ViewChatMessage } from 'src/app/site/pages/meetings/pages/chat'; import { ViewUser } from 'src/app/site/pages/meetings/view-models/view-user'; @@ -29,7 +30,9 @@ export class ChatGroupDetailMessageComponent { } public get author(): string { - if (this.user) { + if (!this.chatMessage.meeting_user_id) { + return this.translate.instant(`removed user`); + } else if (this.user) { return this.user.short_name; } return ``; @@ -51,6 +54,8 @@ export class ChatGroupDetailMessageComponent { return this.chatMessage?.user; } + private translate = inject(TranslateService); + public constructor( private _operator: OperatorService, private _vp: ViewPortService