Skip to content

Commit

Permalink
Merge pull request #707 from KwonIan/email_format_fix
Browse files Browse the repository at this point in the history
checked for empty rowValue as well
  • Loading branch information
yang-ruoxi authored Sep 19, 2024
2 parents cd634d7 + 5b0f9c1 commit 3d158a7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/utils/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(':');
Expand Down

0 comments on commit 3d158a7

Please sign in to comment.