From 133149a92ee6a0add5ddaf90fde001378626eed3 Mon Sep 17 00:00:00 2001 From: Nikhil Dewoolkar Date: Mon, 12 Feb 2024 22:03:47 +0530 Subject: [PATCH 1/2] Update MentionUserRenderer.tsx --- .../HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx index ad9cfb4e6384..890835072852 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx @@ -43,7 +43,7 @@ function MentionUserRenderer({style, tnode, TDefaultRenderer, currentUserPersona navigationRoute = ROUTES.PROFILE.getRoute(htmlAttribAccountID); } else if ('data' in tnode && !isEmptyObject(tnode.data)) { // We need to remove the LTR unicode and leading @ from data as it is not part of the login - displayNameOrLogin = tnode.data.replace(CONST.UNICODE.LTR, '').slice(1); + displayNameOrLogin = tnode.data.replace(CONST.UNICODE.LTR, '').slice(1).toLowerCase(); accountID = PersonalDetailsUtils.getAccountIDsByLogins([displayNameOrLogin])?.[0]; navigationRoute = ROUTES.DETAILS.getRoute(displayNameOrLogin); From 5f57376033a241e6a76aedb94d9837ae8b5109e8 Mon Sep 17 00:00:00 2001 From: Nikhil Dewoolkar Date: Tue, 20 Feb 2024 10:53:16 +0530 Subject: [PATCH 2/2] last task --- .../HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx | 2 +- src/libs/PersonalDetailsUtils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx index 1d9da408ead2..8e0ce759d021 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.tsx @@ -43,7 +43,7 @@ function MentionUserRenderer({style, tnode, TDefaultRenderer, currentUserPersona navigationRoute = ROUTES.PROFILE.getRoute(htmlAttribAccountID); } else if ('data' in tnode && !isEmptyObject(tnode.data)) { // We need to remove the LTR unicode and leading @ from data as it is not part of the login - displayNameOrLogin = tnode.data.replace(CONST.UNICODE.LTR, '').slice(1).toLowerCase(); + displayNameOrLogin = tnode.data.replace(CONST.UNICODE.LTR, '').slice(1); accountID = PersonalDetailsUtils.getAccountIDsByLogins([displayNameOrLogin])?.[0]; navigationRoute = ROUTES.DETAILS.getRoute(displayNameOrLogin); diff --git a/src/libs/PersonalDetailsUtils.ts b/src/libs/PersonalDetailsUtils.ts index a881dd411221..55aee10e611a 100644 --- a/src/libs/PersonalDetailsUtils.ts +++ b/src/libs/PersonalDetailsUtils.ts @@ -64,7 +64,7 @@ function getPersonalDetailsByIDs(accountIDs: number[], currentUserAccountID: num */ function getAccountIDsByLogins(logins: string[]): number[] { return logins.reduce((foundAccountIDs, login) => { - const currentDetail = personalDetails.find((detail) => detail?.login === login); + const currentDetail = personalDetails.find((detail) => detail?.login === login?.toLowerCase()); if (!currentDetail) { // generate an account ID because in this case the detail is probably new, so we don't have a real accountID yet foundAccountIDs.push(UserUtils.generateAccountID(login));