From ca703c014b628019d99fc250ff5817a72a301734 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 13 Jan 2025 16:00:11 +0700 Subject: [PATCH] fix: translation and lint --- src/languages/es.ts | 2 +- src/libs/actions/Report.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index e791fb06e0f0..fcdcc0beaaec 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -4656,7 +4656,7 @@ const translations = { }; }, upgradedWorkspace: 'mejoró este espacio de trabajo al plan Controlar', - downgradedWorkspace: 'bajó este espacio de trabajo al plan Recopilar', + downgradedWorkspace: 'bajó de categoría este espacio de trabajo al plan Recopilar', }, roomMembersPage: { memberNotFound: 'Miembro no encontrado.', diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index a0138fb384cf..48181e2181c3 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1363,8 +1363,8 @@ function readNewestAction(reportID: string | undefined, shouldResetUnreadMarker /** * Sets the last read time on a report */ -function markCommentAsUnread(reportID?: string, reportActionCreated?: string) { - if (reportID === '-1' || !reportID) { +function markCommentAsUnread(reportID: string | undefined, reportActionCreated: string | undefined) { + if (!reportID) { Log.warn('7339cd6c-3263-4f89-98e5-730f0be15784 Invalid report passed to MarkCommentAsUnread. Not calling the API because it wil fail.'); return; } @@ -1386,7 +1386,8 @@ function markCommentAsUnread(reportID?: string, reportActionCreated?: string) { // If no action created date is provided, use the last action's from other user const actionCreationTime = - reportActionCreated ?? latestReportActionFromOtherUsers?.created ?? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.lastVisibleActionCreated ?? DateUtils.getDBTime(0); + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + reportActionCreated || latestReportActionFromOtherUsers?.created ?? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.lastVisibleActionCreated ?? DateUtils.getDBTime(0); // We subtract 1 millisecond so that the lastReadTime is updated to just before a given reportAction's created date // For example, if we want to mark a report action with ID 100 and created date '2014-04-01 16:07:02.999' unread, we set the lastReadTime to '2014-04-01 16:07:02.998'