Compare commits

..
4 Commits
3 changed files with 9 additions and 4 deletions

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "journal.pl", "name": "journal.pl",
"version": "3.6.0", "version": "3.6.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "journal.pl", "name": "journal.pl",
"version": "3.6.0", "version": "3.6.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@brojs/cli": "^0.0.4-beta.0", "@brojs/cli": "^0.0.4-beta.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "journal.pl", "name": "journal.pl",
"version": "3.6.0", "version": "3.6.2",
"description": "bro-js platform journal ui repo", "description": "bro-js platform journal ui repo",
"main": "./src/index.tsx", "main": "./src/index.tsx",
"scripts": { "scripts": {
+6 -1
View File
@@ -24,6 +24,8 @@ import {
StudentList, StudentList,
BreadcrumbsWrapper, BreadcrumbsWrapper,
} from './style' } from './style'
import { useAppSelector } from '../__data__/store'
import { isTeacher } from '../utils/user'
export function getGravatarURL(email, user) { export function getGravatarURL(email, user) {
if (!email) return void 0 if (!email) return void 0
@@ -37,6 +39,8 @@ export function getGravatarURL(email, user) {
const LessonDetail = () => { const LessonDetail = () => {
const { lessonId, courseId } = useParams() const { lessonId, courseId } = useParams()
const canvRef = useRef(null) const canvRef = useRef(null)
const user = useAppSelector((s) => s.user)
const { const {
isFetching, isFetching,
data: accessCode, data: accessCode,
@@ -45,6 +49,7 @@ const LessonDetail = () => {
} = api.useCreateAccessCodeQuery( } = api.useCreateAccessCodeQuery(
{ lessonId }, { lessonId },
{ {
skip: !isTeacher(user),
pollingInterval: pollingInterval:
Number(getConfigValue('journal.polling-interval')) || 3000, Number(getConfigValue('journal.polling-interval')) || 3000,
skipPollingIfUnfocused: true, skipPollingIfUnfocused: true,
@@ -144,7 +149,7 @@ const LessonDetail = () => {
<QRCanvas ref={canvRef} /> <QRCanvas ref={canvRef} />
</a> </a>
<StudentList> <StudentList>
{studentsArr.map((student) => ( {isTeacher(user) && studentsArr.map((student) => (
<UserCard <UserCard
wrapperAS="li" wrapperAS="li"
key={student.sub} key={student.sub}