Skip to content

Commit

Permalink
Typescript casting seems to break react-native-dotenv's ability to re…
Browse files Browse the repository at this point in the history
…place vars
  • Loading branch information
rmarscher committed Oct 30, 2023
1 parent 2148313 commit 560cfac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/expo/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (api) {
{
moduleName: '@env',
path: '../../.env',
allowlist: ['NEXT_PUBLIC_SUPABASE_URL', 'NEXT_PUBLIC_SUPABASE_ANON_KEY'],
allowlist: ['NEXT_PUBLIC_SUPABASE_URL', 'NEXT_PUBLIC_SUPABASE_ANON_KEY', 'NEXT_PUBLIC_APP_URL', 'NEXT_PUBLIC_API_URL', 'NEXT_PUBLIC_SUPPORT_EMAIL'],
safe: false,
allowUndefined: true
}
Expand Down
4 changes: 2 additions & 2 deletions packages/app/provider/solito-image/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SolitoImageProvider as SolitoImageProviderOG } from 'solito/image'

const imageURL = process.env.NEXT_PUBLIC_APP_URL as `http:${string}` | `https:${string}`
const imageURL = process.env.NEXT_PUBLIC_APP_URL

export const SolitoImageProvider = ({
children,
}: {
children: React.ReactNode
}): React.ReactNode => {
return <SolitoImageProviderOG nextJsURL={imageURL}>{children}</SolitoImageProviderOG>
return <SolitoImageProviderOG nextJsURL={imageURL as `http:${string}` | `https:${string}`}>{children}</SolitoImageProviderOG>
}
6 changes: 3 additions & 3 deletions packages/app/utils/supabase/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { createClient } from '@supabase/supabase-js'
import * as SecureStore from 'expo-secure-store'
import 'react-native-url-polyfill/auto'

const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL as string
const supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY as string
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL
const supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY

export const ExpoSecureStoreAdapter = {
getItem: (key: string) => SecureStore.getItemAsync(key),
setItem: (key: string, value: string) => SecureStore.setItemAsync(key, value),
removeItem: (key: string) => SecureStore.deleteItemAsync(key),
}

export const supabase = createClient(supabaseUrl, supabaseKey, {
export const supabase = createClient(supabaseUrl as string, supabaseKey as string, {
auth: {
storage: ExpoSecureStoreAdapter,
autoRefreshToken: true,
Expand Down

0 comments on commit 560cfac

Please sign in to comment.