Commit 119e1c08 authored by v.mattfeld's avatar v.mattfeld
Browse files

update routes to STUDY_SIZE variable

parent 79504bf4
......@@ -9,6 +9,7 @@ import { useRecoilState } from 'recoil';
import { attentionCheckState, Check } from 'pages/annotate';
import { logger } from 'utils/logger';
import { fetcher } from 'utils/utils';
import { STUDY_SIZE } from 'db/db';
const validateSchema = Yup.object({
sensitivity: Yup.string().required(),
......@@ -37,8 +38,8 @@ const Form: FC<FormProps> = ({ pageNumber, uid, imageID, refetch, isCheck }) =>
const { isQuestionOne } = currentCheck
useEffect(() => {
if (pageNumber > 100)
// redirect to done after 100 submits
if (pageNumber > STUDY_SIZE)
// redirect to done after STUDY_SIZE submits
router.push('/done')
}, [pageNumber, router])
......
......@@ -32,11 +32,12 @@ if (!process.env.NEXT_PUBLIC_IMAGE_SERVER) {
process.exit(1);
}
const STUDY_SIZE: number = parseInt(process.env.NEXT_PUBLIC_STUDY_SIZE);
const STUDY_SIZE_HALF: number = Math.floor(STUDY_SIZE / 2);
const GRAPHQL_URL: string = process.env.NEXT_PUBLIC_GRAPHQL_URL;
const IMAGE_SERVER: string = process.env.NEXT_PUBLIC_IMAGE_SERVER;
const ACCUMULATION_SIZE: number = parseInt(
// TODO: refactor into seperate file
export const STUDY_SIZE: number = parseInt(process.env.NEXT_PUBLIC_STUDY_SIZE);
export const STUDY_SIZE_HALF: number = Math.floor(STUDY_SIZE / 2);
export const GRAPHQL_URL: string = process.env.NEXT_PUBLIC_GRAPHQL_URL;
export const IMAGE_SERVER: string = process.env.NEXT_PUBLIC_IMAGE_SERVER;
export const ACCUMULATION_SIZE: number = parseInt(
process.env.NEXT_PUBLIC_ACCUMULATION_SIZE
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment