fix: setup page must not show complete when API fails
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
91a04c0979
commit
c4f2dbea89
@ -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'état d'initialisation
|
||||
</Typography>
|
||||
<Alert severity="error" sx={{ mb: 2 }}>
|
||||
L'API n'a pas répondu. Vérifiez que{' '}
|
||||
<strong>VITE_API_BASE_URL</strong> correspond à l'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 }}>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user