diff --git a/src/components/Account.tsx b/src/components/Account.tsx index 8aab5994..4e843e26 100644 --- a/src/components/Account.tsx +++ b/src/components/Account.tsx @@ -29,11 +29,6 @@ export default function Account({ session }: { session: Session }) { const [gender, setGender] = useState(''); const [raceEthnicity, setRaceEthnicity] = useState(''); - useEffect(() => { - // eslint-disable-next-line @typescript-eslint/no-use-before-define - if (session) getProfile(); - }, [session]); - const getProfile = async () => { try { setLoading(true); @@ -65,6 +60,10 @@ export default function Account({ session }: { session: Session }) { } }; + useEffect(() => { + if (session) getProfile(); + }, [session]); + const updateProfile = async () => { try { setLoading(true); diff --git a/src/lib/supabase.ts b/src/lib/supabase.ts deleted file mode 100644 index ec375377..00000000 --- a/src/lib/supabase.ts +++ /dev/null @@ -1,21 +0,0 @@ -import 'react-native-url-polyfill/auto'; -import AsyncStorage from '@react-native-async-storage/async-storage'; -import { createClient } from '@supabase/supabase-js'; - -const supabaseUrl = - process.env.EXPO_PUBLIC_SUPABASE_URL || - 'supabase url not found as an env variable'; -const supabaseAnonKey = - process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY || - 'supabase anon key not found as an env variable'; - -const supabase = createClient(supabaseUrl, supabaseAnonKey, { - auth: { - storage: AsyncStorage, - autoRefreshToken: true, - persistSession: true, - detectSessionInUrl: false, - }, -}); - -export default supabase;