Skip to content

Commit

Permalink
fix: dependency in useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
ajyey committed Jun 30, 2023
1 parent efe26be commit 8b2028e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/popup/components/home/emails/EmailList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ function EmailList({
};

useEffect(() => {
console.log(searchResults);
// Check if the currently selectedEmail is present in the searchResults list.
const isSelectedEmailInResults = searchResults.some((result) => {
const email = isFuseResult(result) ? result.item : result;
Expand Down Expand Up @@ -131,7 +132,7 @@ function EmailList({
// Call the onFilteredEmailsCountChange callback with the searchResults length.
// This can be used by the parent component to update the count of filtered emails.
onFilteredEmailsCountChange(searchResults.length);
}, [searchResults, onFilteredEmailsCountChange]);
}, [searchResults]);

return (
<div className="h-[310px] overflow-y-auto overflow-x-hidden scrollbar pt-2 pb-2">
Expand Down

0 comments on commit 8b2028e

Please sign in to comment.