diff --git a/frontend/src/screens/Inbox.jsx b/frontend/src/screens/Inbox.jsx index e15ce4e..2e3baf4 100644 --- a/frontend/src/screens/Inbox.jsx +++ b/frontend/src/screens/Inbox.jsx @@ -959,6 +959,24 @@ export default function Inbox() { markDuplicate.mutate({ id: item.id, isDuplicate: !item.duplicate, kind: item.kind }) } + const sync = useMutation({ + mutationFn: () => inboxApi.syncMailbox(), + onSuccess: async (res) => { + await qc.invalidateQueries({ queryKey: qk.mailbox.all() }) + // /email/fetch reports what the intake gate did with the page. The key is + // additive and absent when the gate is disabled, so fall back to the old + // message rather than rendering "undefined filtered out". + const t = res?.triage + toast( + t + ? `Mailbox synced — ${t.ingested} imported, ${t.skipped} filtered out` + : 'Mailbox synced', + 'success', + ) + }, + onError: (err) => toast(friendlyAuthError(err, 'Sync failed'), 'error'), + }) + return (
Google Sheets · Form data )} + {!isForms && ( + + )}