Skip to content

Commit

Permalink
Handle chat messages with meeting_user_id set to null (#4062)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianjoel authored Sep 5, 2024
1 parent 308e724 commit 2c86470
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 ``;
Expand All @@ -51,6 +54,8 @@ export class ChatGroupDetailMessageComponent {
return this.chatMessage?.user;
}

private translate = inject(TranslateService);

public constructor(
private _operator: OperatorService,
private _vp: ViewPortService
Expand Down

0 comments on commit 2c86470

Please sign in to comment.