feat(#14): finalisation redirection et nettoyage
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,13 +15,8 @@ class AdminDashboardScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AdminDashboardScreenState extends State<AdminDashboardScreen> {
|
||||
/// null = chargement du statut setup, true/false = connu
|
||||
bool? _setupCompleted;
|
||||
|
||||
/// 0 = Gestion des utilisateurs, 1 = Paramètres
|
||||
int mainTabIndex = 0;
|
||||
|
||||
/// Sous-onglet quand mainTabIndex == 0 : 0=Gestionnaires, 1=Parents, 2=AM, 3=Administrateurs
|
||||
int subIndex = 0;
|
||||
|
||||
@override
|
||||
@@ -38,8 +33,11 @@ class _AdminDashboardScreenState extends State<AdminDashboardScreen> {
|
||||
_setupCompleted = completed;
|
||||
if (!completed) mainTabIndex = 1;
|
||||
});
|
||||
} catch (_) {
|
||||
if (mounted) setState(() => _setupCompleted = true);
|
||||
} catch (e) {
|
||||
if (mounted) setState(() {
|
||||
_setupCompleted = false;
|
||||
mainTabIndex = 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,9 +94,7 @@ class _AdminDashboardScreenState extends State<AdminDashboardScreen> {
|
||||
|
||||
Widget _getBody() {
|
||||
if (mainTabIndex == 1) {
|
||||
return ParametresPanel(
|
||||
onSetupCompleted: () => setState(() => _setupCompleted = true),
|
||||
);
|
||||
return ParametresPanel(redirectToLoginAfterSave: !_setupCompleted!);
|
||||
}
|
||||
switch (subIndex) {
|
||||
case 0:
|
||||
|
||||
Reference in New Issue
Block a user