2 Commits

Author SHA1 Message Date
Primakov Alexandr Alexandrovich
d4b7d0616e 3.6.1 2024-12-15 17:14:49 +03:00
Primakov Alexandr Alexandrovich
b5bd2e02d7 not create access token if not teacher 2024-12-15 17:03:14 +03:00
3 changed files with 8 additions and 3 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "journal.pl",
"version": "3.6.0",
"version": "3.6.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "journal.pl",
"version": "3.6.0",
"version": "3.6.1",
"license": "MIT",
"dependencies": {
"@brojs/cli": "^0.0.4-beta.0",

View File

@@ -1,6 +1,6 @@
{
"name": "journal.pl",
"version": "3.6.0",
"version": "3.6.1",
"description": "bro-js platform journal ui repo",
"main": "./src/index.tsx",
"scripts": {

View File

@@ -24,6 +24,8 @@ import {
StudentList,
BreadcrumbsWrapper,
} from './style'
import { useAppSelector } from '../__data__/store'
import { isTeacher } from '../utils/user'
export function getGravatarURL(email, user) {
if (!email) return void 0
@@ -37,6 +39,8 @@ export function getGravatarURL(email, user) {
const LessonDetail = () => {
const { lessonId, courseId } = useParams()
const canvRef = useRef(null)
const user = useAppSelector((s) => s.user)
const {
isFetching,
data: accessCode,
@@ -45,6 +49,7 @@ const LessonDetail = () => {
} = api.useCreateAccessCodeQuery(
{ lessonId },
{
skip: !isTeacher(user),
pollingInterval:
Number(getConfigValue('journal.polling-interval')) || 3000,
skipPollingIfUnfocused: true,