From 3f8676aa184dc5fc6d800fef6aca7a5300b47e42 Mon Sep 17 00:00:00 2001 From: zfurtak Date: Fri, 20 Sep 2024 14:49:02 +0100 Subject: [PATCH] Fixed eslint issues --- src/libs/NextStepUtils.ts | 6 +++--- src/libs/actions/Policy/Tag.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/NextStepUtils.ts b/src/libs/NextStepUtils.ts index b66bf0b0abfa..23045c8a7215 100644 --- a/src/libs/NextStepUtils.ts +++ b/src/libs/NextStepUtils.ts @@ -43,8 +43,8 @@ function parseMessage(messages: Message[] | undefined) { let tagType = part.type ?? 'span'; let content = Str.safeEscape(part.text); - const previousPart = messages[index - 1]; - const nextPart = messages[index + 1]; + const previousPart = messages.at(index - 1); + const nextPart = messages.at(index + 1); if (currentUserEmail === part.text || part.clickToCopyText === currentUserEmail) { tagType = 'strong'; @@ -73,7 +73,7 @@ function getNextApproverDisplayName(policy: Policy, ownerAccountID: number, subm return ReportUtils.getDisplayNameForParticipant(submitToAccountID); } - const nextApproverEmail = approvalChain.length === 1 ? approvalChain.at(0) : approvalChain[approvalChain.indexOf(currentUserEmail) + 1]; + const nextApproverEmail = approvalChain.length === 1 ? approvalChain.at(0) : approvalChain.at(approvalChain.indexOf(currentUserEmail) + 1); if (!nextApproverEmail) { return ReportUtils.getDisplayNameForParticipant(submitToAccountID); } diff --git a/src/libs/actions/Policy/Tag.ts b/src/libs/actions/Policy/Tag.ts index a0d5aae745a3..ff8f811e9921 100644 --- a/src/libs/actions/Policy/Tag.ts +++ b/src/libs/actions/Policy/Tag.ts @@ -476,8 +476,8 @@ function clearPolicyTagListErrors(policyID: string, tagListIndex: number) { function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName: string}, tagListIndex: number) { const policy = PolicyUtils.getPolicy(policyID); - const tagList = PolicyUtils.getTagLists(allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`] ?? {})?.[tagListIndex] ?? {}; - const tag = tagList.tags?.[policyTag.oldName]; + const tagList = PolicyUtils.getTagLists(allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`] ?? {})?.at(tagListIndex); + const tag = tagList?.tags?.[policyTag.oldName]; const oldTagName = policyTag.oldName; const newTagName = PolicyUtils.escapeTagName(policyTag.newName);