fix: setup page must not show complete when API fails

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Your Name 2026-06-30 09:24:48 +02:00
parent 91a04c0979
commit c4f2dbea89

View File

@ -41,7 +41,7 @@ export function SetupPage() {
},
});
const needsSetup = statusQ.data?.needsSetup ?? false;
const needsSetup = statusQ.data?.needsSetup ?? true;
const setupEnabled = statusQ.data?.setupEnabled ?? false;
const submitCreate = async () => {
@ -92,6 +92,28 @@ export function SetupPage() {
);
}
if (statusQ.isError) {
return (
<Box sx={{ minHeight: '100vh', display: 'grid', placeItems: 'center', px: 2 }}>
<Card sx={{ width: '100%', maxWidth: 520 }}>
<CardContent>
<Typography variant="h5" sx={{ fontWeight: 900, mb: 1 }}>
Impossible de vérifier l&apos;état d&apos;initialisation
</Typography>
<Alert severity="error" sx={{ mb: 2 }}>
L&apos;API n&apos;a pas répondu. Vérifiez que{' '}
<strong>VITE_API_BASE_URL</strong> correspond à l&apos;URL publique (ex.{' '}
<code>http://prediqo.redirectme.net:9080</code>) puis reconstruisez le frontend.
</Alert>
<Button variant="outlined" onClick={() => void statusQ.refetch()}>
Réessayer
</Button>
</CardContent>
</Card>
</Box>
);
}
if (!needsSetup) {
return (
<Box sx={{ minHeight: '100vh', display: 'grid', placeItems: 'center', px: 2 }}>