chore: resolve react-hooks/exhaustive-deps warnings
Goes through the 7 exhaustive-deps warnings individually: Added the genuinely-missing dependency (safe, no extra churn): - email-viewer useMemo: add effectiveEmailContent.hasStyleTag (used for hasOwnLayout; changes in lockstep with .html, closing a latent staleness gap). - pro-compose-tab-body handleSend: add refreshCurrentMailbox (stable zustand selector) and drop the stale fetchEmails/selectedMailbox deps — which left those two selectors entirely unused, so remove them too. - use-mailbox-drop handleDrop: add sourceMailboxId (changes in lockstep with draggedEmails, already a dep). Suppressed with a justified comment where depending on the whole object would regress behavior — these are intentional fine-grained deps: - email-composer signature-swap effect (keyed to signature fields + prev*Ref guards; whole signatureIdentity would re-splice the live editor). - email-viewer auto-mark-as-read (whole email would reset the delay timer on any unrelated field update). - email-viewer effective-attachments memo (derives from email.attachments; whole email would churn the list + its layout measurement). - email-viewer auto-MDN effect (email already captured via id + sendReadReceiptNow; autoMdnRef guards double-send). tsc --noEmit clean; eslint now reports 0 problems.
This commit is contained in:
committed by
Linus Rath
parent
0b7203df0f
commit
3516d3c727
@@ -25,11 +25,9 @@ export function ProComposeTabBody({ tabId, data }: ProComposeTabBodyProps) {
|
||||
const t = useTranslations();
|
||||
const client = useAuthStore((s) => s.client);
|
||||
const sendEmail = useEmailStore((s) => s.sendEmail);
|
||||
const fetchEmails = useEmailStore((s) => s.fetchEmails);
|
||||
const refreshCurrentMailbox = useEmailStore((s) => s.refreshCurrentMailbox);
|
||||
const fetchScheduledEmails = useEmailStore((s) => s.fetchScheduledEmails);
|
||||
const refreshScheduledMetadata = useEmailStore((s) => s.refreshScheduledMetadata);
|
||||
const selectedMailbox = useEmailStore((s) => s.selectedMailbox);
|
||||
const isScheduledView = useEmailStore((s) => s.isScheduledView);
|
||||
const closeTab = useProTabStore((s) => s.closeTab);
|
||||
const updateTabTitle = useProTabStore((s) => s.updateTabTitle);
|
||||
@@ -116,7 +114,7 @@ export function ProComposeTabBody({ tabId, data }: ProComposeTabBodyProps) {
|
||||
console.error('Failed to send email:', error);
|
||||
toast.error(t('notifications.error_sending'));
|
||||
}
|
||||
}, [client, sendEmail, fetchEmails, selectedMailbox, closeTab, data.sourceEmailId, data.mode, t, handleScheduledSendCreated]);
|
||||
}, [client, sendEmail, closeTab, data.sourceEmailId, data.mode, t, handleScheduledSendCreated, refreshCurrentMailbox]);
|
||||
|
||||
const handleClose = useCallback(() => {
|
||||
closeTab(tabIdRef.current);
|
||||
|
||||
Reference in New Issue
Block a user