diff --git a/packages/web/.env.example b/packages/web/.env.example index 2091845e..40653b63 100644 --- a/packages/web/.env.example +++ b/packages/web/.env.example @@ -2,3 +2,4 @@ NEXT_PUBLIC_SUPABASE_URL=https://xxxxxxxxxxx.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key NEXT_PUBLIC_TGI_API_ENDPOINT=http://localhost:8080 SUPABASE_SERVICE_ROLE_SECRET="" +NEXT_PUBLIC_FEEDBACK_VERSION=v0.0.2 diff --git a/packages/web/app/feedback/page.tsx b/packages/web/app/feedback/page.tsx index 141c08df..dcc18992 100644 --- a/packages/web/app/feedback/page.tsx +++ b/packages/web/app/feedback/page.tsx @@ -36,16 +36,16 @@ export default function UserFeedback() { // }; const randQuestionId = () => { - return Math.floor(Math.random() * 291); + return Math.floor(Math.random() * 237); }; - const shuffleArray = (array: Number[]) => { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - [array[i], array[j]] = [array[j], array[i]]; - } - return array; - }; + // const shuffleArray = (array: Number[]) => { + // for (let i = array.length - 1; i > 0; i--) { + // const j = Math.floor(Math.random() * (i + 1)); + // [array[i], array[j]] = [array[j], array[i]]; + // } + // return array; + // }; // const shuffledQuestionIds = shuffleArray(question_idArray); const [currentIndex, setCurrentIndex] = useState(0); @@ -69,13 +69,14 @@ export default function UserFeedback() { useEffect(() => { const getCard = async () => { const randId = randQuestionId(); - console.log("Fetching cards " + randId); + // console.log("Fetching cards " + randId); try { const cardsArray: Array> = []; const { data: newCards, error } = await supabase .from(TABLES.FEEDBACK_CARDS) .select("*") - .eq("question_id", randId); + .eq("question_id", randId) + .eq("model_version", process.env.NEXT_PUBLIC_FEEDBACK_VERSION); if (newCards) { setCards(newCards); } @@ -154,6 +155,10 @@ export default function UserFeedback() { Next question )} + +

+ {process.env.NEXT_PUBLIC_FEEDBACK_VERSION} +