[FIX] makeThreadName asserting undefined as non-null (#3628)

This commit is contained in:
Reinaldo Neto 2022-01-19 17:41:21 -03:00 committed by GitHub
parent 9d25636cf4
commit 44d2b4b0e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -60,6 +60,6 @@ export const getBadgeColor = ({
};
export const makeThreadName = (messageRecord: { id?: string; msg?: string; attachments?: IAttachment[] }): string | undefined =>
messageRecord.msg || messageRecord.attachments![0].title;
messageRecord.msg || messageRecord?.attachments?.[0]?.title;
export const isTeamRoom = ({ teamId, joined }: { teamId: string; joined: boolean }): boolean => !!teamId && joined;