Users: Add back check for undefined / null for value for lastSeenAtAge in table view (#84265)

bug: add check for undefined / null for value
This commit is contained in:
Eric Leijonmarck 2024-03-12 14:22:13 +01:00 committed by GitHub
parent 6eaab9e57d
commit 0cb9f2bb8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -109,7 +109,7 @@ export const OrgUsersTable = ({
id: 'lastSeenAtAge',
header: 'Last active',
cell: ({ cell: { value } }: Cell<'lastSeenAtAge'>) => {
return <>{value && value === '10 years' ? <Text color={'disabled'}>Never</Text> : value}</>;
return <>{value && <>{value === '10 years' ? <Text color={'disabled'}>Never</Text> : value}</>}</>;
},
sortType: (a, b) => new Date(a.original.lastSeenAt).getTime() - new Date(b.original.lastSeenAt).getTime(),
},

View File

@ -117,7 +117,7 @@ export const UsersTable = ({
iconName: 'question-circle',
},
cell: ({ cell: { value } }: Cell<'lastSeenAtAge'>) => {
return <>{value && value === '10 years' ? <Text color={'disabled'}>Never</Text> : value}</>;
return <>{value && <>{value === '10 years' ? <Text color={'disabled'}>Never</Text> : value}</>}</>;
},
sortType: (a, b) => new Date(a.original.lastSeenAt!).getTime() - new Date(b.original.lastSeenAt!).getTime(),
},