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:
@@ -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<MenuResponse>(`/menus/${cached.menuId}`);
|
||||
setMenu(data.menu);
|
||||
|
||||
Reference in New Issue
Block a user