fix(mobile): configure Purchases on menu editor load

"There is no singleton instance" when tapping Yayınla — the app can
land directly on /menu (e.g. iOS restoring the last screen on
relaunch) without ever running index.tsx's routing gate, so
Purchases.configure() was never called. Menu editor's load() now
configures it defensively too, same pattern as account/subscription.tsx.
This commit is contained in:
AyrisAI
2026-08-20 13:52:17 +03:00
parent 67cd5a488c
commit 6fb91c94ff
+2 -1
View File
@@ -16,7 +16,7 @@ import * as Haptics from "expo-haptics";
import { api } from "@/lib/api"; import { api } from "@/lib/api";
import { getActiveRestaurant, type ActiveRestaurant } from "@/lib/active-restaurant"; import { getActiveRestaurant, type ActiveRestaurant } from "@/lib/active-restaurant";
import { getPublicMenuUrl, getPublicMenuDisplayUrl } from "@/lib/urls"; import { getPublicMenuUrl, getPublicMenuDisplayUrl } from "@/lib/urls";
import { getCustomerInfo, isProActive } from "@/lib/purchases"; import { configurePurchases, getCustomerInfo, isProActive } from "@/lib/purchases";
import { CategoryPillBar } from "@/components/menu/CategoryPillBar"; import { CategoryPillBar } from "@/components/menu/CategoryPillBar";
import { MenuItemCard, type MenuItemData } from "@/components/menu/MenuItemCard"; import { MenuItemCard, type MenuItemData } from "@/components/menu/MenuItemCard";
import { ItemDetailSheet } from "@/components/menu/ItemDetailSheet"; import { ItemDetailSheet } from "@/components/menu/ItemDetailSheet";
@@ -67,6 +67,7 @@ export default function MenuEditorScreen() {
return; return;
} }
setActive(cached); setActive(cached);
configurePurchases(cached.restaurantId);
const data = await api.get<MenuResponse>(`/menus/${cached.menuId}`); const data = await api.get<MenuResponse>(`/menus/${cached.menuId}`);
setMenu(data.menu); setMenu(data.menu);