From 6fb91c94ffaa16e07664af4c48233cbd70786ed4 Mon Sep 17 00:00:00 2001 From: AyrisAI Date: Thu, 20 Aug 2026 13:52:17 +0300 Subject: [PATCH] fix(mobile): configure Purchases on menu editor load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "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. --- apps/mobile/src/app/menu/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/mobile/src/app/menu/index.tsx b/apps/mobile/src/app/menu/index.tsx index e1a18b7..594b3cc 100644 --- a/apps/mobile/src/app/menu/index.tsx +++ b/apps/mobile/src/app/menu/index.tsx @@ -16,7 +16,7 @@ import * as Haptics from "expo-haptics"; import { api } from "@/lib/api"; import { getActiveRestaurant, type ActiveRestaurant } from "@/lib/active-restaurant"; 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 { MenuItemCard, type MenuItemData } from "@/components/menu/MenuItemCard"; import { ItemDetailSheet } from "@/components/menu/ItemDetailSheet"; @@ -67,6 +67,7 @@ export default function MenuEditorScreen() { return; } setActive(cached); + configurePurchases(cached.restaurantId); const data = await api.get(`/menus/${cached.menuId}`); setMenu(data.menu);