diff --git a/src/utils/table.tsx b/src/utils/table.tsx index f133de64..48e8c4ac 100644 --- a/src/utils/table.tsx +++ b/src/utils/table.tsx @@ -255,15 +255,12 @@ export const initColumns = (columns: Column[], disableRichColumnHeaders?: boolea case ColumnFormat.EMAIL: c.cell = (row: any) => { const rowValue = getRowValueFromSelectorString(c.selector, row); - let firstAuthor: string; - if (typeof rowValue === 'string') { - firstAuthor = - typeof rowValue === 'string' && rowValue.includes(',') + const firstAuthor = + typeof rowValue === 'string' + ? rowValue.includes(',') ? rowValue.split(',')[0] - : rowValue; - } else { - firstAuthor = ''; - } + : rowValue + : ''; let emailAddressPart = ''; if (c && c.formatOptions && typeof row[c.formatOptions.emailAddressKey] === 'string') { const parts = row[c.formatOptions.emailAddressKey].split(':');