diff --git a/frontend/src/views/QuizView.vue b/frontend/src/views/QuizView.vue index 584f45c..34373c1 100644 --- a/frontend/src/views/QuizView.vue +++ b/frontend/src/views/QuizView.vue @@ -29,14 +29,17 @@ const fetchUserIQ = async () => { graphComponent.value.addData(userIq); }; +const displayDisclaimer = async () => { + const categoryName = await APIClient.getCategoryName(id_category); + if (categoryName === 'Community') { // checking name because id is different in production + disclaimer.value = true; + } +} + onMounted(() => { fetchNewQuestion(); fetchUserIQ(); - - // Check if URL is matching to community category - if (route.params.id_category === '23') { - disclaimer.value = true; - } + displayDisclaimer(); }); @@ -66,11 +69,10 @@ onMounted(() => {