From 6feaaeb24ca7c2bedd7e449e69465076b0272ed6 Mon Sep 17 00:00:00 2001 From: echo Date: Sat, 6 Jun 2026 04:29:09 +0200 Subject: [PATCH] fix expo public convex url --- app.json | 12 ------------ app/_layout.tsx | 40 +++++++++++++++++++++++++++++++++++++++- eas.json | 11 ++++++++++- 3 files changed, 49 insertions(+), 14 deletions(-) diff --git a/app.json b/app.json index a4ebf87..f2f05f0 100644 --- a/app.json +++ b/app.json @@ -21,18 +21,6 @@ "package": "mk.mojmajstor.app", "softwareKeyboardLayoutMode": "resize", "intentFilters": [ - { - "action": "VIEW", - "data": [ - { - "scheme": "mojmajstor" - } - ], - "category": [ - "BROWSABLE", - "DEFAULT" - ] - }, { "action": "VIEW", "data": [ diff --git a/app/_layout.tsx b/app/_layout.tsx index 769dd04..3ee0e4d 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -6,7 +6,22 @@ import AsyncStorage from "@react-native-async-storage/async-storage"; import { ThemeProvider, useTheme } from "../components/theme"; import { ToastProvider } from "../components/ui/toast"; -const convex = new ConvexReactClient(process.env.EXPO_PUBLIC_CONVEX_URL!); +const CONVEX_URL = process.env.EXPO_PUBLIC_CONVEX_URL; + +function getConvexClient(): ConvexReactClient | null { + if (!CONVEX_URL) { + console.error("Missing EXPO_PUBLIC_CONVEX_URL environment variable"); + return null; + } + try { + return new ConvexReactClient(CONVEX_URL); + } catch (e) { + console.error("Failed to create Convex client:", e); + return null; + } +} + +const convex = getConvexClient(); type AuthState = { token: string | null; @@ -140,6 +155,14 @@ export default function RootLayout() { if (!loaded) return null; + if (!convex) { + return ( + + + + ); + } + return ( @@ -156,3 +179,18 @@ export default function RootLayout() { ); } + +function MissingConfigScreen() { + const theme = useTheme(); + return ( + + ⚙️ + + Конфигурациска грешка + + + Недостасува EXPO_PUBLIC_CONVEX_URL. Проверете ја конфигурацијата за изградба. + + + ); +} diff --git a/eas.json b/eas.json index 8917238..cad1993 100644 --- a/eas.json +++ b/eas.json @@ -8,6 +8,9 @@ "developmentClient": true, "distribution": "internal", "channel": "development", + "env": { + "EXPO_PUBLIC_CONVEX_URL": "https://decisive-owl-34.eu-west-1.convex.cloud" + }, "android": { "buildType": "apk" }, @@ -18,13 +21,19 @@ "preview": { "distribution": "internal", "channel": "preview", + "env": { + "EXPO_PUBLIC_CONVEX_URL": "https://decisive-owl-34.eu-west-1.convex.cloud" + }, "android": { "buildType": "apk" } }, "production": { "channel": "production", - "autoIncrement": true + "autoIncrement": true, + "env": { + "EXPO_PUBLIC_CONVEX_URL": "https://decisive-owl-34.eu-west-1.convex.cloud" + } } }, "submit": {