fix(dashboard): use learner view for lesson lock empty states (#764)
Lock checks gated on isOrgStudent missed org-site students where isStudentExperience is true but org role may be unset. Introduce isCourseLearnerView (student experience OR org student) and mirror the exercise page branch structure so locked lessons always show StudentContentLockedNotice instead of the teacher empty state. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>
This commit is contained in:
co-authored by
Cursor Agent
Rotimi Best
parent
7a867dad45
commit
3ef286ed39
@@ -25,7 +25,7 @@
|
||||
import { page } from '$app/state';
|
||||
import { profile } from '$lib/utils/store/user';
|
||||
import { isOrgAdmin } from '$lib/utils/store/org';
|
||||
import { isOrgStudent } from '$lib/utils/store/app';
|
||||
import { isCourseLearnerView } from '$lib/utils/store/app';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
import { ContentType } from '@cio/utils/constants/content';
|
||||
import type { CourseMember } from '$features/course/utils/types';
|
||||
@@ -104,7 +104,7 @@
|
||||
const showContentAskAiBar = $derived(
|
||||
isCourseReady &&
|
||||
isLessonOrExercisePage &&
|
||||
!($isOrgStudent && isContentLockedForStudent) &&
|
||||
!($isCourseLearnerView && isContentLockedForStudent) &&
|
||||
sidePanel.activePanelId !== AI_ASSISTANT_PANEL_ID
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user