Skip to content

Commit

Permalink
Changes for MEFS to launch in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Zio-4 committed May 23, 2024
1 parent c40db22 commit 1086888
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/components/GameTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,16 @@ async function routeExternalTask(game) {
if (game.taskData.name.toLowerCase() === 'mefs') {
const ageInMonths = getAgeData(props.userData.birthMonth, props.userData.birthYear).ageMonths;
url += `participantID=${props.userData.id}&participantAgeInMonths=${ageInMonths}&lng=${locale.value}`;
window.open(url, '_blank').focus();
await authStore.completeAssessment(selectedAdmin.value.id, game.taskId);
} else {
url += `&participant=${props.userData.assessmentPid}${
props.userData.schools.length ? '&schoolId=' + props.userData.schools.current.join('“%2C”') : ''
}${props.userData.classes.current.length ? '&classId=' + props.userData.classes.current.join('“%2C”') : ''}`;
}
await authStore.completeAssessment(selectedAdmin.value.id, game.taskId);
window.location.href = url;
await authStore.completeAssessment(selectedAdmin.value.id, game.taskId);
window.location.href = url;
}
}
const returnVideoOptions = (videoURL) => {
Expand Down
9 changes: 6 additions & 3 deletions src/pages/HomeParticipant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ const {
keepPreviousData: true,
enabled: initialized,
staleTime: 5 * 60 * 1000, // 5 min
// For MEFS, since it is opened in a separate tab
refetchOnWindowFocus: 'always',
});
const administrationIds = computed(() => (assignmentInfo.value ?? []).map((assignment) => assignment.id));
Expand Down Expand Up @@ -173,14 +175,15 @@ const {
data: taskInfo,
} = useQuery({
queryKey: ['tasks', authStore.uid, taskIds],
queryFn: () =>
fetchDocsById(
queryFn: () => {
return fetchDocsById(
taskIds.value.map((taskId) => ({
collection: 'tasks',
docId: taskId,
})),
'app',
),
);
},
keepPreviousData: true,
enabled: initialized,
staleTime: 5 * 60 * 1000,
Expand Down

0 comments on commit 1086888

Please sign in to comment.