Skip to content

Commit b1d816d

Browse files
committed
Add small cleanup to SearchUIUtils
1 parent 2dd971e commit b1d816d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libs/SearchUIUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ function getShouldShowMerchant(data: OnyxTypes.SearchResults['data']): boolean {
110110
});
111111
}
112112

113-
const currentYear = new Date().getFullYear();
114-
115113
/**
116114
* Type guard that checks if something is a ReportListItemType
117115
*/
@@ -138,7 +136,9 @@ function isReportActionListItemType(item: TransactionListItemType | ReportListIt
138136
/**
139137
* Checks if the date of transactions or reports indicate the need to display the year because they are from a past year.
140138
*/
141-
function shouldShowYear(data: TransactionListItemType[] | ReportListItemType[] | OnyxTypes.SearchResults['data']): boolean {
139+
function shouldShowYear(data: TransactionListItemType[] | ReportListItemType[] | OnyxTypes.SearchResults['data']) {
140+
const currentYear = new Date().getFullYear();
141+
142142
if (Array.isArray(data)) {
143143
return data.some((item: TransactionListItemType | ReportListItemType) => {
144144
if (isReportListItemType(item)) {

0 commit comments

Comments
 (0)