diff --git a/apps/x/apps/renderer/src/components/email-view.tsx b/apps/x/apps/renderer/src/components/email-view.tsx index f2fc5ca3..69f9b91e 100644 --- a/apps/x/apps/renderer/src/components/email-view.tsx +++ b/apps/x/apps/renderer/src/components/email-view.tsx @@ -843,7 +843,7 @@ export function EmailView({ initialThreadId, threadIdVersion }: EmailViewProps = const [refreshing, setRefreshing] = useState(!hadPersistedDataOnMount.current) const [error, setError] = useState(null) const [query, setQuery] = useState('') - // Gmail connection status — null while checking, false shows the connect prompt. + // Gmail sync uses the native Google OAuth connection. const [emailConnected, setEmailConnected] = useState(null) const [settingsOpen, setSettingsOpen] = useState(false) @@ -851,15 +851,18 @@ export function EmailView({ initialThreadId, threadIdVersion }: EmailViewProps = let cancelled = false const check = async () => { try { - const result = await window.ipc.invoke('composio:get-connection-status', { toolkitSlug: 'gmail' }) - if (!cancelled) setEmailConnected(result.isConnected) + const oauthState = await window.ipc.invoke('oauth:getState', null) + if (!cancelled) setEmailConnected(oauthState.config?.google?.connected ?? false) } catch { if (!cancelled) setEmailConnected(false) } } void check() - const cleanup = window.ipc.on('oauth:didConnect', () => { void check() }) - return () => { cancelled = true; cleanup() } + const cleanupOAuthConnect = window.ipc.on('oauth:didConnect', () => { void check() }) + return () => { + cancelled = true + cleanupOAuthConnect() + } }, []) useEffect(() => { persistedImportant = important }, [important]) diff --git a/apps/x/apps/renderer/src/components/meetings-view.tsx b/apps/x/apps/renderer/src/components/meetings-view.tsx index 436fe42b..5f74688d 100644 --- a/apps/x/apps/renderer/src/components/meetings-view.tsx +++ b/apps/x/apps/renderer/src/components/meetings-view.tsx @@ -190,7 +190,7 @@ function UpcomingEvents() { const [loading, setLoading] = useState(true) const [error, setError] = useState(null) const [refreshTick, setRefreshTick] = useState(0) - // Calendar connection status — null while checking, false shows the connect prompt. + // Calendar sync uses the native Google OAuth connection. const [calendarConnected, setCalendarConnected] = useState(null) const [settingsOpen, setSettingsOpen] = useState(false) @@ -198,15 +198,18 @@ function UpcomingEvents() { let cancelled = false const check = async () => { try { - const result = await window.ipc.invoke('composio:get-connection-status', { toolkitSlug: 'googlecalendar' }) - if (!cancelled) setCalendarConnected(result.isConnected) + const oauthState = await window.ipc.invoke('oauth:getState', null) + if (!cancelled) setCalendarConnected(oauthState.config?.google?.connected ?? false) } catch { if (!cancelled) setCalendarConnected(false) } } void check() - const cleanup = window.ipc.on('oauth:didConnect', () => { void check() }) - return () => { cancelled = true; cleanup() } + const cleanupOAuthConnect = window.ipc.on('oauth:didConnect', () => { void check() }) + return () => { + cancelled = true + cleanupOAuthConnect() + } }, []) const loadEvents = useCallback(async () => {