Skip to content

Commit

Permalink
οΈπŸ“ŠπŸŽ† ↝ [SSG-84 SSG-81]: AI4M fixed on prod/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Gizmotronn committed Dec 6, 2024
1 parent 7164bf8 commit 5f5f5dc
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions components/Projects/Auto/AI4Mars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,40 +156,40 @@ export function AiForMarsProject() {

const [hasMission20000006, setHasMission20000006] = useState<boolean | null>(null);

useEffect(() => {
const checkTutorialMission = async () => {
if (!session) return;
// useEffect(() => {
// const checkTutorialMission = async () => {
// if (!session) return;

try {
const { data: missionData, error: missionError } = await supabase
.from('missions')
.select('id')
.eq('user', session.user.id)
.eq('mission', '20000006')
.limit(1);
// try {
// const { data: missionData, error: missionError } = await supabase
// .from('missions')
// .select('id')
// .eq('user', session.user.id)
// .eq('mission', '20000006')
// .limit(1);

if (missionError) {
console.error("Error fetching mission data:", missionError);
setHasMission20000006(false);
return;
};
// if (missionError) {
// console.error("Error fetching mission data:", missionError);
// setHasMission20000006(false);
// return;
// };

setHasMission20000006(missionData && missionData.length > 0);
} catch (error) {
console.error("Error checking user mission: ", error);
setHasMission20000006(false);
};
};
// setHasMission20000006(missionData && missionData.length > 0);
// } catch (error) {
// console.error("Error checking user mission: ", error);
// setHasMission20000006(false);
// };
// };

checkTutorialMission();
}, [session, supabase]);
// checkTutorialMission();
// }, [session, supabase]);

useEffect(() => {
async function fetchAnomaly() {
if (!session) {
setLoading(false);
return;
}
};

try {
const { data: anomalyData, error: anomalyError } = await supabase
Expand All @@ -212,7 +212,7 @@ export function AiForMarsProject() {
};
};

if (session && hasMission20000006) {
if (session) { // && hasMission20000006) {
fetchAnomaly();
};
}, [session, hasMission20000006, supabase]);
Expand Down

0 comments on commit 5f5f5dc

Please sign in to comment.