From 9b28e309b4dce1d016c71fe94dad57fdab1d65be Mon Sep 17 00:00:00 2001 From: Ian Kwon Date: Tue, 20 Aug 2024 16:01:31 -0700 Subject: [PATCH 1/2] fixed invisible emails in contribs explorer --- src/utils/table.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/table.tsx b/src/utils/table.tsx index 648596e5..9dbe0742 100644 --- a/src/utils/table.tsx +++ b/src/utils/table.tsx @@ -256,7 +256,10 @@ export const initColumns = (columns: Column[], disableRichColumnHeaders?: boolea c.cell = (row: any) => { const rowValue = getRowValueFromSelectorString(c.selector, row); const firstAuthor = - typeof rowValue === 'string' && rowValue.includes(',') ? rowValue.split(',')[0] : ''; + //typeof rowValue === 'string' && rowValue.includes(',') ? rowValue.split(',')[0] : ''; + typeof rowValue === 'string' && rowValue.includes(',') + ? rowValue.split(',')[0] + : rowValue; let emailAddressPart = ''; if (c && c.formatOptions && typeof row[c.formatOptions.emailAddressKey] === 'string') { const parts = row[c.formatOptions.emailAddressKey].split(':'); From 8aba54dd9ecca49b20ebbc73b9dae8c6ee9af9fa Mon Sep 17 00:00:00 2001 From: Ian Kwon Date: Tue, 17 Sep 2024 15:36:35 -0700 Subject: [PATCH 2/2] added validation to make sure that rowValue is a string --- src/utils/table.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils/table.tsx b/src/utils/table.tsx index 9dbe0742..4da0c66a 100644 --- a/src/utils/table.tsx +++ b/src/utils/table.tsx @@ -255,11 +255,14 @@ export const initColumns = (columns: Column[], disableRichColumnHeaders?: boolea case ColumnFormat.EMAIL: c.cell = (row: any) => { const rowValue = getRowValueFromSelectorString(c.selector, row); - const firstAuthor = - //typeof rowValue === 'string' && rowValue.includes(',') ? rowValue.split(',')[0] : ''; - typeof rowValue === 'string' && rowValue.includes(',') - ? rowValue.split(',')[0] - : rowValue; + if (typeof rowValue === 'string') { + const firstAuthor = + typeof rowValue === 'string' && rowValue.includes(',') + ? rowValue.split(',')[0] + : rowValue; + } else { + const firstAuthor = ''; + } let emailAddressPart = ''; if (c && c.formatOptions && typeof row[c.formatOptions.emailAddressKey] === 'string') { const parts = row[c.formatOptions.emailAddressKey].split(':');