From f02c69a43d2bfe8b56b11455934cd85cc5b2b686 Mon Sep 17 00:00:00 2001 From: Rajat Parashar Date: Wed, 7 Jul 2021 15:22:53 +0530 Subject: [PATCH 1/2] Conversion to Boolean --- src/libs/OptionsListUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 1516c836c89d..c410f929bb95 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -215,7 +215,7 @@ function createOption(personalDetailList, report, draftComments, { login: !hasMultipleParticipants ? personalDetail.login : null, reportID: report ? report.reportID : null, isUnread: report ? report.unreadActionCount > 0 : null, - hasDraftComment: reportDraftComment && reportDraftComment.length > 0, + hasDraftComment: !!reportDraftComment && reportDraftComment.length > 0, keyForList: report ? String(report.reportID) : personalDetail.login, searchText: getSearchText(report, personalDetailList), isPinned: lodashGet(report, 'isPinned', false), From 4215686f8148d1139cfdec72e993ff35380fc6f4 Mon Sep 17 00:00:00 2001 From: Rajat Parashar Date: Thu, 8 Jul 2021 04:07:52 +0530 Subject: [PATCH 2/2] refactor --- src/libs/OptionsListUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index c410f929bb95..1bba6241187e 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -215,7 +215,7 @@ function createOption(personalDetailList, report, draftComments, { login: !hasMultipleParticipants ? personalDetail.login : null, reportID: report ? report.reportID : null, isUnread: report ? report.unreadActionCount > 0 : null, - hasDraftComment: !!reportDraftComment && reportDraftComment.length > 0, + hasDraftComment: _.size(reportDraftComment) > 0, keyForList: report ? String(report.reportID) : personalDetail.login, searchText: getSearchText(report, personalDetailList), isPinned: lodashGet(report, 'isPinned', false),