Skip to content

Commit

Permalink
Remove if/else checks for Expo Go
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Miller committed Nov 2, 2023
1 parent 921e23e commit 73dfcea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
9 changes: 3 additions & 6 deletions packages/app/features/sign-in/screen.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,9 @@ export const SignInScreen = (): React.ReactNode => {
password: password,
})
if (error) {
const isExpoGo = Constants.appOwnership === 'expo'
if (!isExpoGo) {
toast.show('Sign in failed', {
description: error.message,
})
}
toast.show('Sign in failed', {
description: error.message,
})
return
}

Expand Down
10 changes: 3 additions & 7 deletions packages/app/features/sign-in/screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { YStack, useToastController } from '@t4/ui'
import { SignUpSignInComponent } from 'app/features/sign-in/SignUpSignIn'
import { useRouter } from 'solito/router'
import type { Provider } from '@supabase/supabase-js'
import Constants from 'expo-constants'
import { capitalizeWord } from 'app/utils/string'
import { isExpoGo } from 'app/utils/flags'
import { useSupabase } from 'app/utils/supabase/hooks/useSupabase'
Expand Down Expand Up @@ -42,12 +41,9 @@ export const SignInScreen = (): React.ReactNode => {
password: password,
})
if (error) {
const isExpoGo = Constants.appOwnership === 'expo'
if (!isExpoGo) {
toast.show('Sign in failed', {
description: error.message,
})
}
toast.show('Sign in failed', {
description: error.message,
})
return
}

Expand Down
9 changes: 1 addition & 8 deletions packages/ui/src/CustomToast.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import Constants, { ExecutionEnvironment } from 'expo-constants'
import { NativeToast as Toast } from './NativeToast'

const isExpo = Constants.executionEnvironment === ExecutionEnvironment.StoreClient

export const CustomToast = (): React.ReactNode => {
if (isExpo) {
return null
} else {
return <Toast />
}
return <Toast />
}

1 comment on commit 73dfcea

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔ EAS production build completed

  • 🤖 Android build failed ❌
  • 🍏 IOS build failed ❌
Android QR IOS QR

Please sign in to comment.