Skip to content

Commit 9cb7d95

Browse files
fixed add teachers button not shown
1 parent 179a7e4 commit 9cb7d95

File tree

1 file changed

+7
-1
lines changed
  • src/client/components/Courses/Course

1 file changed

+7
-1
lines changed

src/client/components/Courses/Course/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ const Course = () => {
122122
boxSizing: 'borderBox',
123123
height: '40px',
124124
}
125+
126+
const isAdminOrResponsible = () => {
127+
return user.isAdmin || chatInstance.responsibilities.find((r) => r.user.username === user.username)
128+
}
129+
const userIsAdminOrResponsible = isAdminOrResponsible()
130+
125131
const handleAddResponsible = async (user: User) => {
126132

127133
const username = user.username
@@ -236,7 +242,7 @@ const Course = () => {
236242
)}
237243
</div>
238244

239-
{user.isAdmin && (
245+
{userIsAdminOrResponsible && (
240246
<>
241247
<Button onClick={() => setShowTeachers(!showTeachers)} style={{ marginTop: 10, marginLeft: -8 }}>
242248
{showTeachers ? t('admin:hideTeachers') : t('admin:showTeachers')}

0 commit comments

Comments
 (0)