Skip to content

Commit 7f35bc5

Browse files
Remove redundant earliestBadge variable, assign directly to actionBadge
Co-authored-by: Aimane Chnaif <aimane-chnaif@users.noreply.github.com>
1 parent 9df5b91 commit 7f35bc5

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/libs/actions/IOU/ReportWorkflow.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ function getIOUReportActionWithBadge(
309309

310310
let actionBadge: ValueOf<typeof CONST.REPORT.ACTION_BADGE> | undefined;
311311
let earliestAction: ReportAction | undefined;
312-
let earliestBadge: ValueOf<typeof CONST.REPORT.ACTION_BADGE> | undefined;
313312

314313
for (const action of Object.values(chatReportActions)) {
315314
if (action?.actionName !== CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW || isDeletedAction(action)) {
@@ -322,14 +321,10 @@ function getIOUReportActionWithBadge(
322321
}
323322
if (!earliestAction?.created || (action.created && action.created < earliestAction.created)) {
324323
earliestAction = action;
325-
earliestBadge = badge;
324+
actionBadge = badge;
326325
}
327326
}
328327

329-
if (earliestAction) {
330-
actionBadge = earliestBadge;
331-
}
332-
333328
return {reportAction: earliestAction, actionBadge};
334329
}
335330

0 commit comments

Comments
 (0)