diff --git a/src/modules/integration-picker/hooks/useIntegrationPicker.ts b/src/modules/integration-picker/hooks/useIntegrationPicker.ts index 0796a0a..f4836fd 100644 --- a/src/modules/integration-picker/hooks/useIntegrationPicker.ts +++ b/src/modules/integration-picker/hooks/useIntegrationPicker.ts @@ -603,7 +603,7 @@ export const useIntegrationPicker = ({ window.removeEventListener('message', processMessageCallback, false); - if (coopDetectedRef.current && pollingIntervalRef.current) return; + if (pollingIntervalRef.current) return; const connectionAttemptId = connectionAttemptIdRef.current; teardownOAuth(); diff --git a/src/shared/components/loading.tsx b/src/shared/components/loading.tsx index 512419f..6db4827 100644 --- a/src/shared/components/loading.tsx +++ b/src/shared/components/loading.tsx @@ -19,7 +19,7 @@ export const Loading: React.FC<{ useEffect(() => { if (!onCancel) return; - timerRef.current = setTimeout(() => setShowCancel(true), 8000); + timerRef.current = setTimeout(() => setShowCancel(true), 5000); return () => { if (timerRef.current) clearTimeout(timerRef.current); }; diff --git a/src/shared/httpClient.ts b/src/shared/httpClient.ts index 0c9ee3e..7b83220 100644 --- a/src/shared/httpClient.ts +++ b/src/shared/httpClient.ts @@ -54,7 +54,9 @@ export async function request({ } } - return (await response.json()) as T; + const text = await response.text(); + if (!text) return null; + return JSON.parse(text) as T; } } catch (error) { logger.error(`Error making request to ${url}`, error);