fix(mobile): add hardcoded production env fallbacks to prevent launch crash

This commit is contained in:
AyrisAI
2026-08-20 02:38:37 +03:00
parent 856347cabd
commit f5eebed0a7
3 changed files with 8 additions and 7 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import { supabase } from "./supabase";
const API_URL = process.env.EXPO_PUBLIC_API_URL ?? "http://localhost:3001";
const DEFAULT_API_URL = "https://api.menul.io";
const API_URL = process.env.EXPO_PUBLIC_API_URL || DEFAULT_API_URL;
async function authHeaders(): Promise<Record<string, string>> {
const { data } = await supabase.auth.getSession();
+4 -5
View File
@@ -2,12 +2,11 @@ import "react-native-url-polyfill/auto";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { createClient } from "@supabase/supabase-js";
const url = process.env.EXPO_PUBLIC_SUPABASE_URL;
const anonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY;
const DEFAULT_SUPABASE_URL = "https://fwahdopsyvryvjaqande.supabase.co";
const DEFAULT_SUPABASE_ANON_KEY = "sb_publishable_9YsK7YU7xfzxJQsz3x5iMA_LHCqUN3b";
if (!url || !anonKey) {
throw new Error("EXPO_PUBLIC_SUPABASE_URL / EXPO_PUBLIC_SUPABASE_ANON_KEY missing");
}
const url = process.env.EXPO_PUBLIC_SUPABASE_URL || DEFAULT_SUPABASE_URL;
const anonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY || DEFAULT_SUPABASE_ANON_KEY;
export const supabase = createClient(url, anonKey, {
auth: {
+2 -1
View File
@@ -1,4 +1,5 @@
const WEB_BASE_URL = process.env.EXPO_PUBLIC_WEB_URL || "http://localhost:3000";
const DEFAULT_WEB_URL = "https://menul.io";
const WEB_BASE_URL = process.env.EXPO_PUBLIC_WEB_URL || DEFAULT_WEB_URL;
export function getPublicMenuUrl(slug: string): string {
if (WEB_BASE_URL.includes("menul.io")) {