From acb35c050f251bc449c49f6daaca6ddb2fd62120 Mon Sep 17 00:00:00 2001 From: Plumey Simon Date: Fri, 26 Apr 2024 10:58:03 +0200 Subject: [PATCH] Correcting communnity disclaimer --- frontend/src/views/QuizView.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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(() => {