From 6930b505f5873283df1d8dc55a81d97204798b62 Mon Sep 17 00:00:00 2001 From: Anusha Date: Thu, 17 Oct 2024 17:01:02 +0500 Subject: [PATCH] hide hold for archived workspace --- src/components/Search/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 670cfef54df8..87d337cc0b7d 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -80,8 +80,10 @@ function prepareTransactionsList(item: TransactionListItemType, selectedTransact return transactions; } - - return {...selectedTransactions, [item.keyForList]: {isSelected: true, canDelete: item.canDelete, canHold: item.canHold, canUnhold: item.canUnhold, action: item.action}}; + const isArchivedReport = ReportUtils.isArchivedRoomWithID(item.reportID); + const canHoldtransaction = !isArchivedReport && item.canHold; + const canDeleteTransaction = !isArchivedReport && item.canDelete; + return {...selectedTransactions, [item.keyForList]: {isSelected: true, canDelete: canDeleteTransaction, canHold: canHoldtransaction, canUnhold: item.canUnhold, action: item.action}}; } function Search({queryJSON, onSearchListScroll, contentContainerStyle}: SearchProps) {