Skip to content

Commit 9052e3d

Browse files
committed
fix: Add error state to GoogleDriveConnectionCard
Show error indicator and message when useGoogleStatus query fails
1 parent 3f750cb commit 9052e3d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

components/frontend/src/components/google-drive-connection-card.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Props = {
1313
}
1414

1515
export function GoogleDriveConnectionCard({ showManageButton = true }: Props) {
16-
const { data: status, isLoading, refetch } = useGoogleStatus()
16+
const { data: status, isLoading, error, refetch } = useGoogleStatus()
1717
const disconnectMutation = useDisconnectGoogle()
1818
const [connecting, setConnecting] = useState(false)
1919
const pollTimerRef = useRef<ReturnType<typeof setInterval> | null>(null)
@@ -128,17 +128,22 @@ export function GoogleDriveConnectionCard({ showManageButton = true }: Props) {
128128
{/* Status section */}
129129
<div className="mb-4">
130130
<div className="flex items-center gap-2 mb-2">
131-
<span className={`w-2 h-2 rounded-full ${status?.connected ? 'bg-green-500' : 'bg-gray-400'}`}></span>
131+
<span className={`w-2 h-2 rounded-full ${error ? 'bg-red-500' : status?.connected ? 'bg-green-500' : 'bg-gray-400'}`}></span>
132132
<span className="text-sm font-medium text-foreground/80">
133-
{status?.connected ? (
133+
{error ? (
134+
'Connection Error'
135+
) : status?.connected ? (
134136
<>Connected{status.email ? ` as ${status.email}` : ''}</>
135137
) : (
136138
'Not Connected'
137139
)}
138140
</span>
139141
</div>
140142
<p className="text-muted-foreground">
141-
Connect to Google Drive to access files in all your sessions via MCP
143+
{error
144+
? 'Failed to check connection status. Please try again.'
145+
: 'Connect to Google Drive to access files in all your sessions via MCP'
146+
}
142147
</p>
143148
</div>
144149

0 commit comments

Comments
 (0)