feat: harden gmail sync foundation
This commit is contained in:
@@ -413,6 +413,16 @@ export default function Correspondence({ jobId, job }: { jobId: number; job: Job
|
||||
<Box sx={{ display: "flex", gap: 1, flexWrap: "wrap" }}>
|
||||
<Chip size="small" color={gmailStatus?.connected ? "success" : "default"} variant="outlined" label={gmailStatus?.connected ? "Gmail connected" : "Gmail not connected"} />
|
||||
<Chip size="small" color={linkedThreadIds.length > 0 ? "success" : "default"} variant="outlined" label={linkedThreadIds.length > 0 ? `Linked threads: ${linkedThreadIds.length}` : "No linked threads yet"} />
|
||||
{gmailStatus?.lastSyncStatus ? (
|
||||
<Chip
|
||||
size="small"
|
||||
color={gmailStatus.lastSyncStatus === "success" ? "success" : "warning"}
|
||||
variant="outlined"
|
||||
label={gmailStatus.lastSyncStatus === "success"
|
||||
? `Last Gmail sync ${gmailStatus.lastSyncMode || "sync"} ok`
|
||||
: `Last Gmail sync ${gmailStatus.lastSyncMode || "sync"} failed`}
|
||||
/>
|
||||
) : null}
|
||||
{linkedThreadRefresh ? (
|
||||
<Chip
|
||||
size="small"
|
||||
@@ -425,6 +435,11 @@ export default function Correspondence({ jobId, job }: { jobId: number; job: Job
|
||||
/>
|
||||
) : null}
|
||||
</Box>
|
||||
{gmailStatus?.lastSyncError ? (
|
||||
<Typography variant="body2" sx={{ color: "warning.main", mt: 1 }}>
|
||||
Latest Gmail sync issue: {gmailStatus.lastSyncError}
|
||||
</Typography>
|
||||
) : null}
|
||||
</Box>
|
||||
|
||||
<Box sx={{ display: "flex", gap: 1, alignItems: "flex-start", mt: 1.5, flexWrap: "wrap" }}>
|
||||
@@ -503,6 +518,8 @@ export default function Correspondence({ jobId, job }: { jobId: number; job: Job
|
||||
</Box>
|
||||
) : null}
|
||||
{gmailStatus.lastSyncedAt ? <Chip label={t("correspondenceLastSynced", { date: new Date(gmailStatus.lastSyncedAt).toLocaleString() })} size="small" /> : null}
|
||||
{gmailStatus.lastSyncAttemptedAt ? <Chip label={`Sync checked ${new Date(gmailStatus.lastSyncAttemptedAt).toLocaleString()}`} size="small" variant="outlined" /> : null}
|
||||
{gmailStatus.lastSyncStatus === "error" && gmailStatus.lastSyncError ? <Chip label={`Sync issue: ${gmailStatus.lastSyncError}`} size="small" color="warning" variant="outlined" /> : null}
|
||||
{linkedThreadIds.length > 0 ? (
|
||||
<Box sx={{ display: "flex", gap: 1, flexWrap: "wrap" }}>
|
||||
<Chip size="small" color="success" variant="outlined" label={`Linked threads: ${linkedThreadIds.length}`} />
|
||||
|
||||
Reference in New Issue
Block a user