From 0cb9f2bb8d7602547a4f4c1e0350612cfaf3afcf Mon Sep 17 00:00:00 2001 From: Eric Leijonmarck Date: Tue, 12 Mar 2024 14:22:13 +0100 Subject: [PATCH] Users: Add back check for undefined / null for value for `lastSeenAtAge` in table view (#84265) bug: add check for undefined / null for value --- public/app/features/admin/Users/OrgUsersTable.tsx | 2 +- public/app/features/admin/Users/UsersTable.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/features/admin/Users/OrgUsersTable.tsx b/public/app/features/admin/Users/OrgUsersTable.tsx index 55918b8ce95..135413ae534 100644 --- a/public/app/features/admin/Users/OrgUsersTable.tsx +++ b/public/app/features/admin/Users/OrgUsersTable.tsx @@ -109,7 +109,7 @@ export const OrgUsersTable = ({ id: 'lastSeenAtAge', header: 'Last active', cell: ({ cell: { value } }: Cell<'lastSeenAtAge'>) => { - return <>{value && value === '10 years' ? Never : value}; + return <>{value && <>{value === '10 years' ? Never : value}}; }, sortType: (a, b) => new Date(a.original.lastSeenAt).getTime() - new Date(b.original.lastSeenAt).getTime(), }, diff --git a/public/app/features/admin/Users/UsersTable.tsx b/public/app/features/admin/Users/UsersTable.tsx index 18ce295ce75..fd7cdbb6813 100644 --- a/public/app/features/admin/Users/UsersTable.tsx +++ b/public/app/features/admin/Users/UsersTable.tsx @@ -117,7 +117,7 @@ export const UsersTable = ({ iconName: 'question-circle', }, cell: ({ cell: { value } }: Cell<'lastSeenAtAge'>) => { - return <>{value && value === '10 years' ? Never : value}; + return <>{value && <>{value === '10 years' ? Never : value}}; }, sortType: (a, b) => new Date(a.original.lastSeenAt!).getTime() - new Date(b.original.lastSeenAt!).getTime(), },