fix: phew, clean up debug cause it works
This commit is contained in:
@@ -1,32 +1,17 @@
|
||||
<script lang="ts">
|
||||
// import { ROLE } from '$lib/utils/constants/roles';
|
||||
import { profile } from '$lib/utils/store/user';
|
||||
import { group } from '../Course/store';
|
||||
import type { Person } from '../Course/components/People/types';
|
||||
import type { GroupPerson } from '$lib/utils/types';
|
||||
|
||||
export let allowedRoles: number[] = [];
|
||||
|
||||
let userRole: number = 0;
|
||||
|
||||
$: {
|
||||
const user: Person = $group.people.find(
|
||||
(person: { profile_id: number }) => person.profile_id === $profile.id
|
||||
)!;
|
||||
const user: GroupPerson = $group.people.find((person) => person.profile_id === $profile.id)!;
|
||||
|
||||
if (user) {
|
||||
userRole = user.role_id;
|
||||
}
|
||||
userRole = user ? user.role_id : userRole;
|
||||
}
|
||||
|
||||
$: console.log({ group: $group });
|
||||
$: console.log(
|
||||
'is allowed',
|
||||
allowedRoles.includes(userRole),
|
||||
'roles',
|
||||
userRole,
|
||||
'allowedRoles',
|
||||
allowedRoles
|
||||
);
|
||||
</script>
|
||||
|
||||
{#if allowedRoles.includes(userRole)}
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
$: console.log('courses layout.svelte');
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
|
||||
@@ -229,11 +229,10 @@
|
||||
$: setAuthor($group, $profile.id);
|
||||
|
||||
$: $newsFeed = $newsFeed.sort((a, b) => Number(b.isPinned) - Number(a.isPinned));
|
||||
$: console.log('courses page.svelte');
|
||||
</script>
|
||||
|
||||
<CourseContainer bind:courseId={data.courseId}>
|
||||
<RoleBasedSecurity allowedRoles={[1, 2, $currentOrg?.customization?.course?.newsfeed ? 3 : 0]}>
|
||||
<RoleBasedSecurity allowedRoles={[1, 2, $currentOrg.customization.course.newsfeed ? 3 : 0]}>
|
||||
<PageNav title={$t('course.navItem.news_feed.heading')} disableSticky={true}>
|
||||
<slot:fragment slot="widget">
|
||||
<RoleBasedSecurity allowedRoles={[1, 2]}>
|
||||
|
||||
@@ -187,7 +187,6 @@
|
||||
lesson_completion = [...lessonData.lesson_completion];
|
||||
}
|
||||
|
||||
console.log('profile locale', $profile.locale);
|
||||
lesson.update((l) => ({
|
||||
...l,
|
||||
id: data.lessonId,
|
||||
|
||||
Reference in New Issue
Block a user