Skip to content

Commit 6aa0c09

Browse files
Sai Sridharclaude
andcommitted
Fix null crash on settings page for total_synced field
Backend can return null for total_synced; updated type to reflect this and added optional chaining to prevent runtime crash. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c2f60cf commit 6aa0c09

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

frontend/lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export interface GmailStatus {
145145
connected: boolean;
146146
email?: string;
147147
last_sync?: string;
148-
total_synced?: number;
148+
total_synced?: number | null;
149149
auth_url?: string;
150150
}
151151

frontend/pages/settings/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,8 @@ function IntegrationsTab({
668668
Last synced: {new Date(gmailStatus.last_sync).toLocaleString()}
669669
</p>
670670
)}
671-
{gmailStatus.total_synced !== undefined && (
672-
<p className="mt-0.5 text-gray-500 dark:text-gray-400">Total emails synced: {gmailStatus.total_synced.toLocaleString()}</p>
671+
{gmailStatus.total_synced != null && (
672+
<p className="mt-0.5 text-gray-500 dark:text-gray-400">Total emails synced: {gmailStatus.total_synced?.toLocaleString()}</p>
673673
)}
674674
</div>
675675
<button

0 commit comments

Comments
 (0)