Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FitseTLT committed Dec 9, 2024
1 parent 480b26c commit b84cead
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hooks/useSearchHighlightAndScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ function useSearchHighlightAndScroll({searchResults, transactions, previousTrans
const [newSearchResultKey, setNewSearchResultKey] = useState<string | null>(null);
const highlightedIDs = useRef<Set<string>>(new Set());
const initializedRef = useRef(false);
const type = queryJSON.type;
const isChat = type === CONST.SEARCH.DATA_TYPES.CHAT;
const isChat = queryJSON.type === CONST.SEARCH.DATA_TYPES.CHAT;

// Trigger search when a new report action is added while on chat or when a new transaction is added for the other search types.
useEffect(() => {
Expand Down Expand Up @@ -59,7 +58,7 @@ function useSearchHighlightAndScroll({searchResults, transactions, previousTrans
searchTriggeredRef.current = true;
}

// Reset the ref when transactions (or report actions in chat search type) are updated
// Reset the ref when transactions or report actions in chat search type are updated
return () => {
searchTriggeredRef.current = false;
};
Expand Down

0 comments on commit b84cead

Please sign in to comment.