From b2f613fbada6d94165b832c90c08da558d814070 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Sun, 16 Jun 2024 23:47:42 +0200 Subject: [PATCH 1/2] Check for -1 default value --- .../UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx index f04b92644d89..99af2261246e 100644 --- a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx +++ b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx @@ -31,7 +31,7 @@ function BaseUserDetailsTooltip({accountID, fallbackUserDetails, icon, delegateA // We replace the actor's email, name, and avatar with the Copilot manually for now. This will be improved upon when // the Copilot feature is implemented. - if (delegateAccountID) { + if (delegateAccountID !== -1) { const delegateUserDetails = personalDetails?.[delegateAccountID]; const delegateUserDisplayName = ReportUtils.getUserDetailTooltipText(delegateAccountID); userDisplayName = `${delegateUserDisplayName} (${translate('reportAction.asCopilot')} ${userDisplayName})`; From 35e875f739e212b33442f372ee6762d6cf58f023 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 17 Jun 2024 00:18:14 +0200 Subject: [PATCH 2/2] Fix TS --- .../UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx index 99af2261246e..c55edd9e6b15 100644 --- a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx +++ b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx @@ -31,7 +31,7 @@ function BaseUserDetailsTooltip({accountID, fallbackUserDetails, icon, delegateA // We replace the actor's email, name, and avatar with the Copilot manually for now. This will be improved upon when // the Copilot feature is implemented. - if (delegateAccountID !== -1) { + if (delegateAccountID && delegateAccountID > 0) { const delegateUserDetails = personalDetails?.[delegateAccountID]; const delegateUserDisplayName = ReportUtils.getUserDetailTooltipText(delegateAccountID); userDisplayName = `${delegateUserDisplayName} (${translate('reportAction.asCopilot')} ${userDisplayName})`;