From 1d78fe8cc12c506a8bbaf4bdbd35f6a313afcd86 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Wed, 26 Aug 2026 23:55:29 +0300 Subject: [PATCH] feat: Instant seamless transition to Teacher Studio Dashboard after onboarding --- backend/app/Controllers/TeacherController.php | 2 +- backend/app/Views/TeacherPortal.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/app/Controllers/TeacherController.php b/backend/app/Controllers/TeacherController.php index a913b8b..450402c 100644 --- a/backend/app/Controllers/TeacherController.php +++ b/backend/app/Controllers/TeacherController.php @@ -32,7 +32,7 @@ class TeacherController $decryptedName = 'معلم جديد'; } - $isComplete = !empty($profile) && !empty($profile['specialization']) && $decryptedName !== 'معلم جديد'; + $isComplete = !empty($profile) && !empty($profile['specialization']); $response->json([ 'status' => 'success', diff --git a/backend/app/Views/TeacherPortal.php b/backend/app/Views/TeacherPortal.php index 4b6bb72..cb25b87 100644 --- a/backend/app/Views/TeacherPortal.php +++ b/backend/app/Views/TeacherPortal.php @@ -1025,10 +1025,11 @@ class TeacherPortal }); const data = await res.json(); if (res.ok && data.status === 'success') { - showSuccess('تم توثيق حسابك بنجاح! جاري توجيهك للاستوديو...'); - setTimeout(async () => { - await checkTeacherSession(token); - }, 1000); + showSuccess('تم توثيق وتفعيل حسابك بنجاح! أهلاً بك في استوديو صَقِل.'); + // Immediate Direct Transition to Studio Dashboard + renderDashboard({ full_name: fullName }, { specialization: spec }); + // Sync in background + checkTeacherSession(token); } else { showError(data.message || 'فشل حفظ الملف الشخصي.'); }