Skip to content

Commit

Permalink
feat: update effect deps so unfavorited emails are removed
Browse files Browse the repository at this point in the history
This commit updates the handlFavoriteButtonClick to only have dependencies on the filter and the filteredEmails so that when a user unfavorites an email, that email is removed from the favorites list immediately
  • Loading branch information
ajyey committed Jun 24, 2023
1 parent 0410a6e commit 1c6aa4f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/pages/popup/components/home/detail/EditButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { EditIcon } from '@pages/popup/components/home/icons/icons';
import handleFavoriteButtonClick from '@pages/popup/components/home/detail/EmailDetailPane';

interface EditButtonProps {
onClick: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/popup/components/home/emails/EmailList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function EmailList({
setFilteredEmails(newFilteredEmails);
};
applyFilter();
}, [maskedEmails, filter]);
}, [filter, filteredEmails]);

// Use Fuse.js to perform the fuzzy search
const fuse: Fuse<MaskedEmail> = new Fuse(filteredEmails, {
Expand Down

0 comments on commit 1c6aa4f

Please sign in to comment.